Forum Discussion

D0minique's avatar
D0minique
Frequent Visitor
5 years ago

Slow switch measure

Hello,

 

I was wondering if somebody has found a working solution for the slow switch statement problem?

For my dashboard I would like to switch between over 100 measures (I call this the base measure). All the measures inside the switch statement are simple column sums and averages. This base measure is used in all kind of other measures, such as YOY calculations. Performance slows down when more measures are added to the switch statement.

I have read multiple posts about this topic, but none of the proposed solutions worked for me unfortunately:
- https://www.reddit.com/r/PowerBI/comments/gaytnc/measure_slow_due_to_weird_switchselectedvalue/

- https://social.msdn.microsoft.com/Forums/windowsapps/en-US/92acbe55-242f-4578-99b1-fc9464e425ea/dax-not-performing-shortcircuit-evaluations-for-the-if-function?forum=sqlkjpowerpivotforexcel

- https://stackoverflow.com/questions/61805513/force-dax-switch-function-to-use-strict-lazy-short-circuit-evaluation

- https://community.powerbi.com/t5/DAX-Commands-and-Tips/Slow-Performance-Switch/m-p/1795454#M37826

- https://community.powerbi.com/t5/Desktop/Slow-Switch-Statement/m-p/1085972#M502954

 

The power bi report server may 2021 feature summary announced that "A performance improvement has been made to SWITCH function with many branches and deeply nested IF functions to eliminate branches which are not selected by user filters or slicers earlier in the calculation pipeline." (https://powerbi.microsoft.com/en-us/blog/power-bi-report-server-may-2021-feature-summary/#perf). But in my case, performance is still too slow.

In addition, I tried to solve this issue by making use of calculation groups. But the same problem applies here. The larger the number of calculation items, the slower the performance; https://community.powerbi.com/t5/Issues/Calculation-Group-slows-down-as-the-number-of-Calculation-Items/idi-p/1706064.

 

Does anybody have an idea how this issue could be solved? Thanks in advance!

Dominique

 

-----------------------------------------------------------------------------

 

Update 6 july 2021:

I would like to thank everyone for helping out πŸ™‚
The solution we chose to implement is dividing the measures over multiple 'switch' measures. Instead of having a single page with many measures, we have multiple copies of the page, each with its own switch measure containing 5 measures at max, using calculation groups to replace the measures in the visuals.

12 Replies