Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

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 sign...
  • jdbuchanan71's avatar
    2 years ago

    You can avoid calcualting the mesure twice by assigning it to a variable.

    YourMeaures =
    VAR _Amount = [Measure] 
    RETURN IF ( _Amount > 1000, "n/m", _Amount )