Forum Discussion

guyinazo's avatar
guyinazo
Icon for Helper I rankHelper I
4 years ago
Solved

If...else run block of statements

I am adding a new column to a table that uses an IF statement.  What would the syntax be if I need to run more than one statement if the condition is true?  So..,

 

If a=1, run this statement, then run this statement and even this third statement, else run this

 

Thanks

  • Hi guyinazo 

     

    Yes, certainly can.  All you need to do is replace the FALSE statement with another IF and continue as such.  For example:

     

    Measure or Column = IF ( 'table'[column] = 1 , "ABC" , IF ( 'table'[column] = 2 , "DEF" , IF ( 'table'[column] = 3 , "GHI"....)

     

    Hope this helps 🙂

     

1 Reply

  • TheoC's avatar
    TheoC
    Icon for Community Champion rankCommunity Champion

    Hi guyinazo 

     

    Yes, certainly can.  All you need to do is replace the FALSE statement with another IF and continue as such.  For example:

     

    Measure or Column = IF ( 'table'[column] = 1 , "ABC" , IF ( 'table'[column] = 2 , "DEF" , IF ( 'table'[column] = 3 , "GHI"....)

     

    Hope this helps 🙂