Forum Discussion
worthywow1988
1 year agoFrequent Visitor
Slow Switch Performance
Hi! I have a switch statement to select a measure depending on the level the user wants to view. The code is similar to this: Selected View = switch(TABLE_VIEW [Selected View],0,[Measure0],1...
- Anonymous1 year ago
You can put the measures into separate card visuals and use Performance Analyzer to test the run time. The run time is divided into three parts, of which the DAX query is mainly related to the calculation of the formula. You can check which part is causing the difference in running time.
Best Regards,
Jing
Greg_Deckler
1 year agoCommunity Champion
worthywow1988 Put your most frequent values first. The SWITCH stops evaluating once a condition evaluates to TRUE. So, for example, let's say that 50% of your cases are 5, you would want that to be the first evaulation condition. Then if your next highest is 3, then that should be the second, and so on.