Forum Discussion
power bi service data's field data type
parry2k yes that is true, but doesn't answer my question.
I had already modelled my data in Power BI Desktop report which was then published to Power BI Service.
Using the Power BI Service feature "Analyze in Excel" which exports odc file when opened in Excel creates connection to Power BI Service dataset and retrieves data into Pivot table.
In that process it appears to have lost data type for numerical values as they appear to be strings (my guess though it could be something else).
This is unexpected behaviour for a feature called "Analyze in Excel".
How can I ensure values retain numerical data types when dataset is retrieved from Power BI Service dataset?
curtisp, firstly, what you get is as expected. If you would like to do some aggregation operations for these numerical type data, you need to:
1). Create one measure column (sum, avg, min ..) in Power BI Desktop. For example, one measure called TotalSalesAmount, TotalSalesAmount = Sum(Sales[SalesAmount])
Please check this article: https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-tutorial-create-measures/
2). When you click "Analyze in Excel", you will find the TotalSalesAmount measure in the ∑ pane in PivotTable fields in the.odc file. You can put it in the ∑ Value column.
- curtisp10 years ago
Helper II
Vicky_Song Thanks. I hadn't seen this in documentation.
Not your fault : ) but this is still unexpected, or at least undesirable : (
Power BI Desktop and in Power BI Service both treat these numerical columns as if they were measures eg allow aggregations etc on them without first using them to create Measures.
But as you point out the "Analyze in Excel" feature needs to have numerical values explicitly defined as measures in order to retain their numerical data type when used by odc connection. Or maybe its better to say that Excel's Pivot Table data model needs this.
In order to cater to "Analyze in Excel" feature/Excel pivot table data model requirements, if I want to use the "Analyze in Excel" feature I have to create a Measure for each of my (many) numerical columns in Power BI that I want to use as Value in Excel Pivot Table via odc connection.
That is a lot of extra work and duplication of numerical values in Power BI (eg the original numerical value and its corresponding Measure).
Is anyone aware of a way to bypass or 'trick' "Analyze in Excel" feature/Excel pivot table to simply accept columns as numerical or treat them as if they were Measures?
Edited to add:
Also a subtle yet important distinction here is that the "Analyze in Excel" feature is about analyzing the Power BI data model (eg Excel Power Pivot data model) not the dataset (eg Excel Power Query query). The Power BI report's data model is what is connected into Excel Pivot Table. I was expecting that I would be analysing the dataset (Power Query), not the data model (Power Pivot), because the "Analyze in Excel" feature is accessed in Datasets.This distinction impacts how the developer/architect will create the Power BI report if they want users to have the "Analyze in Excel" feature eg will have to create Measures.
Also what is interesting to note is that in Excel a Power Query query model can be used as a Pivot Table data source, and it's numerical values (defined as numerical in Power Query) are treated as such in the Pivot Table, without need to invoke Power Pivot to create model Measures.
- trebgatte10 years ago
Most Valuable Professional
I'm glad to see it's not just me complaining about this. :smileyhappy: I posted this over the weekend, same issue. http://community.powerbi.com/t5/Service/Analyze-in-Excel-oddity/m-p/37609
I don't yet have a workaround for this.
Treb Gatte, Power BI Red Carpet Partner | Microsoft MVP | Twitter | Blog | Blog 2
- curtisp10 years ago
Helper II
The immediate workaround is to use Excel's OLAP Tools to create Measures in the Excel's new Pivot Table cube.
At least that way they don't have to be created in the Power BI model and just in Excel where they are needed. Still duplication of effort though.
I guess there is no way around this as Power BI Report data is stored in SSAS database which is specified in the .odc connection file and which creates the Excel data connection used by Pivot Table.
I have tried to use the SSAS database connection string in the .odc file to use Power Query to connect to the Power BI report's SSAS database. That Power Query could be used as Pivot Table data source. No luck with this yet. The SSAS string is pretty long and Power Query doesn't accept longer than 128 characters for SSAS database url.
Are there any configuration options in the SSAS connection that might ignore using Measures. Perhaps 'TypedMeasureColumns = false])' ?