Forum Discussion
Anonymous
3 years agoNot applicable
Help with SWITCH() and performance issue
Hi, I am encountering performance issues where my table takes a long time to load due to a measure. I have the table on the left which is the result of many calculations. I want to create a mea...
amitchandak
3 years agoSuper User
Anonymous , Try like
Measure new=
VAR SelectedSubcategory = SELECTEDVALUE(DAT[Subcategory])
RETURN
IF(
SelectedSubcategory in{ "AA1" ,"AA2" , "CAT1" , "CAT2" , "CAT3" , "CAT4" , "CAT5" , "CAT6"},
calculate([Measure], DAT[Subcategory] =SelectedSubcategory), // Default measure
BLANK()
)
- Anonymous3 years agoNot applicable
Hi amitchandak thank you for your reply.
This is not the solution as I would like to do the following switch:
measure2 AA2 = measure1 AA1,
measure2 CAT1= measure1 AA2,
measure2 CAT2 = measure1 CAT1, etc..
Perhaps the code that I provided was a bit confusing due to the var names.