Forum Discussion
Switch(SELECTEDVALUE DAX Slow performance
Anonymous , Option, Try if you can use field parameters
Second, in place of measure have measure calculation itself
Switch(SELECTEDVALUE(Time_Frame_Selection[Time Frame],"year"), "Year", CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31")),
"Quarter", CALCULATE(SUM(Sales[Sales Amount]),DATESQTD('Date'[Date],"12/31")),
"Period", CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
)
refer this example
https://medium.com/chandakamit/power-bi-when-i-felt-lazy-and-i-needed-too-many-measures-ed8de20d9f79
amitchandak thanks for the quick response. Option 2 (placing the actual measure calucation in the switch statement measure) does NOT speed things up. Same problem occurs? Option 1 (field parameters) does improve performance but is not an option because I have tons of measures relying on these disconnected tables and it would require building many filed parameter tables that would be hard to maintain. Is there a solution to improve the performance? I don't understand why this is happening? Thanks for your help, really appreciate your time.