@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.
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])' ?