Forum Discussion

JacksonMaui's avatar
JacksonMaui
Frequent Visitor
4 years ago
Solved

Multiple IF statements in DAX

Creating a new Column or Change original - I am trying to Divide a Value in a Column based on the Value's Name. I have multiple NAMEs and VALUEs to change. I am unable to add multiple IF statements. ...
  • karnold's avatar
    4 years ago

    You could specify another IF() function in the ResultFalse (aka else) parameter. The last IF() would return the original value. See: IF – DAX Guide For example 

    Column = IF('DSR'[Name]="CureTimeValue",[VALUE]/10, 
                 IF('DSR'[Name]="SomethingelseValue",[VALUE]/15,
                      [Value]
                   )
               )

     Another, maybe better option is Switch() SWITCH – DAX Guide. Example:

    Column = SWITCH('DSR'[Name],
                    "CureTimeValue",[VALUE]/10,
                    "SomethingelseValue",[Value]/15,
                    [Value]
              )

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know. Thanks a lot!