Forum Discussion
michael_knight
6 years agoPost Prodigy
Optimizing a measure
Hi, I've got a measure and it's performing terribly in the Performance Analyzer so I'm wondering if anyone can help in optimzing the measure? This is how I got the measure, there are qu...
- 6 years ago
Hi v-alq-msft
Apologies for the late reply. I figured this problem out myself. I simple cut down on the amount of VARs I was using, I created a seperate measure and referred to that in the new measure rather than referring to the VAR. That seemed to help with the optimization of some of the measure
Thanks for the reply, much appreciated!
Mike
v-alq-msft
6 years agoCommunity Support
Hi, michael_knight
Based on my research, I'd like to suggest you use "NOT in" and use variables instead of repeating fields.
Here is my example.
You may create a measure as follows. It is inefficent.
Measure 1 =
IF(
MAX('Table'[Class])<>"c1"&&MAX('Table'[Class])<>"c2",
1,0
)
You can use the modified measures.
Measure 2 =
var _class = MAX('Table'[Class])
return
IF(
_class<>"c1"&&_class<>"c2",
1,0
)
Measure 3 =
IF(
NOT MAX('Table'[Class]) in {"c1","c2"},
1,0
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.