How to nest IF statements effectively in Power BI


Most languages allow multiple conditions in an IF statement… except for DAX. You have to nest your IF statements in DAX. It becomes a little bit messy when the number of conditions increases.

With this in mind, I just want to know why DAX cannot perform “if then else”? Would they be including this function in the future? Or is there any easier or simpler way I could perform this in DAX? I hope someone can shed some light on this.

Thanks in advance!


You can use if then else in the query editor in M language in a custom column.

For a DAX measure have a look at explaining the SWITCH formula.

Hope this helps.



SWITCH/TRUE logic is the answer here

You could try using this:

Measure = 
Switch ( True(), 
 condition1,"Result1"  , 
    condition1,"Result1"  , 
etc...                     ) 

See here for an explanation