Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Nested IF statement in custom column

I'm relatively new to PowerBI and having a little trouble wih the syntax for transposing a nested IF statement from Excel.    My Excel formula reads: =IF(H2="NULL", "None" , IF(H2>B2,"Late", IF((I...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous 

     

    You should provide some sample data in a format which people can copy, otherwise we are doing with our imagination...not sure if you want to add a custom column  in M or DAX, modify the Table name and Column name accordingly

    here is M - Power Query Custom Column, you click Add Column -> Custom Column in GUI

    if [H] = null then "None"
    else if [H]>[B] then "Late"
    else if [I] <-7 then "Early"
    else "Good"

    here is DAX Calculated column

    Column = IF(ISBLANK([H]),"None",
    IF([H]>[B],"Late",IF([I]<-7,"Early","Good")))