Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

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!

1 ACCEPTED SOLUTION

@Anonymous

 

New Column = 

Switch (Position[Formal]),

"B", "Blue",

"R", "Red",

"Y", "Yellow",

"Other")





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




View solution in original post

5 REPLIES 5
vanessafvg
Community Champion
Community Champion

@Anonymous

 

column = switch(fieldname,

                           "b", "Blue",

                          "r", "red")

 

 

etc





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Anonymous
Not applicable

Thanks @vanessafvg

 

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

@Anonymous

 

whats your field name?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




@Anonymous

 

New Column = 

Switch (Position[Formal]),

"B", "Blue",

"R", "Red",

"Y", "Yellow",

"Other")





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Anonymous
Not applicable

Position (Formal)

 

Will this be a new column, or change the existing?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.