Forum Discussion
Anonymous
2 years agoNot applicable
If statement for calculation heavy functions
Hi all,
I am trying to make a if statement like this
If (measure >1000, "n/m", measure)
However, in this case the i wonder if powerbi is doing the measure calculation 2 times which may significantly slower the run time.
Have been thinking to use Min(1000, Measure) but i would like to return the result "n/m" if the result is bigger than 1000
Thanks!
You can avoid calcualting the mesure twice by assigning it to a variable.
YourMeaures = VAR _Amount = [Measure] RETURN IF ( _Amount > 1000, "n/m", _Amount )
1 Reply
- jdbuchanan71Super User
You can avoid calcualting the mesure twice by assigning it to a variable.
YourMeaures = VAR _Amount = [Measure] RETURN IF ( _Amount > 1000, "n/m", _Amount )