Forum Discussion
DAX Measure Optimization - Please help
- 7 months ago
Hi Sir, Thank you for your reply! There is indeed a relationship between DimKPI and FactProductivity via key "KPIKey". However, when I use the version that you suggested I received the following error "A single value for column 'KPIKey' in table 'DimKPI' cannot be determined. This can happen when a measure or function formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result."
This is fine though, I will use the TRETAS measure that you confirmed is definitely the best alternative to the original measure. Thanks a lot again!
My suggestion would be to make a new meaure out of your calculate statement:
New Measure =
CALCULATE (
[CY Periodical Generic - Productivity - DCount LastEmployeeKey],
KEEPFILTERS ( DimKPI[KPIKey] = _KPIKey )
Maybe also make a numeric parameter for your KPI key so you can use that value in multiple measures so you don't have to change it all the different places.
Once that new meausure is in the model, you can add it to your summarizecolumns statement without declaring the code in there. My guess is that calculate statement inside of the summarizecolumns is what's slowing it down.