Forum Discussion
power bi service data's field data type
Data modelling can be done in PowerBI Desktop or with Power Query in excel.
Here are some useful links for PowerBI Desktop
https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-shape-and-combine-data/
https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-data-view/
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?
- Vicky_Song10 years agoImpactful Individual
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 agoHelper 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 agoMost 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