Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago
Solved

Dax Statement Help - Multiple IF Statements

In my dataset, I have a column with multiple text values.  I am looking for assistance with a DAX statement that will allow me to change the values (in a new column) to something more description.  For instance:

 

If B = Blue, If R=Red, If Y = Yellow

 

I am having problems creating mutliple conditions and have Power BI accept the statement.

 

Thanks in advance for the help!

  • vanessafvg's avatar
    vanessafvg
    9 years ago

    Anonymous

     

    New Column = 

    Switch (Position[Formal]),

    "B", "Blue",

    "R", "Red",

    "Y", "Yellow",

    "Other")

5 Replies

  • vanessafvg's avatar
    vanessafvg
    Community Champion

    Anonymous

     

    column = switch(fieldname,

                               "b", "Blue",

                              "r", "red")

     

     

    etc

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks vanessafvg

       

      Hate to be so literal, but can you write the exact dax statement?