powerbi

power bi access token api working fine in postman but not working in angular app

こ雲淡風輕ζ 提交于 2019-12-11 08:02:07
问题 I'm calling power bi API in postman which is working good and as an accepted result I'm getting. while that app I'm calling in the angular app it's not working. I'm getting response null. I have attached my code below, Please help me out I have been trying to solve this issue last few days. API: https://login.microsoftonline.com/common/oauth2/token Below is my angular code getAccessToken(param): Observable<any> { const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/x

DAX create empty table with specific column names and no rows

久未见 提交于 2019-12-11 07:47:55
问题 How to create a table with a specified column name and no rows at all. The following oneliner does what I want but shows error message that there should be second argument in ROW function. EmptyTable = ROW ("Product") I would like to use it for making bridge tables with desired column name. For example I want Product_bridge table to have a column "Product". Product_bridge = DISTINCT( UNION( DISTINCT( Sales[Prod_Name] ) ,DISTINCT( Dictionary[Prod_DifferntName]) ,DISTINCT( PriceList[P] ) )) The

How to import datasets as csv file to power bi using rest api?

一个人想着一个人 提交于 2019-12-11 07:34:35
问题 I want to automate the import process in power bi, But I can't find how to publish a csv file as a dataset. I'm using a C# solution for this. Is there a way to do that? 回答1: You can't directly import CSV files into a published dataset in Power BI Service. AddRowsAPIEnabled property of datasets published from Power BI Desktop is false , i.e. this API is disabled. Currently the only way to enable this API is to create a push dataset programatically using the API (or create a streaming dataset

How to calculate the total of a column in a table

随声附和 提交于 2019-12-11 07:33:21
问题 In my table below, I've got the measure "Valor Total" as: Valor total = SUM('Códigos e valores'[Valor unitário])*SUM(Csv[Quant.]) This works ok for all the rows of the table except for the grand total at the bottom, because the definition can't be quantity * price. The problem here is that the field "Quant" is on a table with many-to-one relationship with another table (Table2). This Table2 has a relationship of one-to-many to table "Códigos e valores" where field "Valor Unitário" is located.

How to split JSON columns in Power BI

元气小坏坏 提交于 2019-12-11 07:28:00
问题 I have imported JSON data from Hive database. The structure looks like the attached. JSON data has been dumped to Hive without normalizing. Is it possible to parse the data?. For example, in the attached image, the mentionedlocations column has some places mentioned and I want them to be in separate rows. 回答1: You can use the Json.Document function to read the column as JSON. I'd suggest creating a custom column with this formula: Record.ToTable(Json.Document([mentionedlocations])) and then

Show as percentage of another column in Power BI

半世苍凉 提交于 2019-12-11 07:19:51
问题 I have a table that looks like this | Date | Total | Loss | |---------------------|---------|--------| | Jan 1 2018 | 90 | 5 | |---------------------|---------|--------| | Jan 3 2018 | 10 | 5 | |---------------------|---------|--------| | Feb 1 2018 | 50 | 5 | |---------------------|---------|--------| | Feb 3 2018 | 50 | 10 | |---------------------|---------|--------| I wanna be able to show in a table how much percentage of "Total" "Loss" is depending on the period. For example if in my

Error running “pbiviz start” in new project folder

只愿长相守 提交于 2019-12-11 07:19:39
问题 This appears to be the same issue another person posted earlier today (Could not connect Custom Visual server in powerBI) but I can supply additional information applicable in my own environment. There is one answer recommending building the simple bar chart example, but I understand that the sample visual.ts that was created by the "new" command should build. I am running the command from within the project folder where the pbiviz.json file was created with the "new" command. Here is an

Count occurrences in Dax

只愿长相守 提交于 2019-12-11 06:25:50
问题 I have the following table: Now, I want to apply some dax instructions to that table, and display this data in a chart: Or in other words, I if it is the first time that the Country's name appears, it must show 1 and 2 for the second time. 回答1: Try this for creating a calculated column called Occurrences : Occurrences = CALCULATE ( COUNT ( [Pais] ), FILTER ( 'Table', [Index] <= EARLIER ( 'Table'[Index] ) && [Pais] = EARLIER ( 'Table'[Pais] ) ) ) Index must be an incremental key in each row.

Manipulating last two rows if there's data based on a Cut date

我的未来我决定 提交于 2019-12-11 06:06:56
问题 This question is a slightly varied version of this one... Now I'm using Measures instead of Calculated columns and the date is static instead of having it based on a dropdown list. Here's the Power BI test .pbix file: https://drive.google.com/open?id=1OG7keqhdvDUDYkFQFMHyxcpi9Zi6Pn3d This printscreen describes what I'm trying to accomplish: Basically the date in P6 Update table is used as a cut date and will be fixed\static. It's imported from an Excel sheet where the user can customize it

Calculate annual total from monthly total using Measure in Power BI

扶醉桌前 提交于 2019-12-11 05:53:01
问题 I want to calculate annual revenue for each month from monthly revenue data. Sample data is shown as below: e.g. For annual revenue of 2015 May = sum of monthly revenue from 2015 Jan to 2015 May, and so on. The problem is, the Monthly Revenue is a measure. I want to create a measure for Annual Revenue as well, so that it can interact with other filters. However, I only know how to write the expression using Calculated Column : Annual Revenue = CALCULATE( [Monthly Revenue], FILTER( 'Month',