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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
irnm8dn
Post Prodigy
Post Prodigy

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

@irnm8dn

 

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
Super User
Super User

@irnm8dn

 

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!




Thanks @vanessafvg

 

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

@irnm8dn

 

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!




@irnm8dn

 

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!




Position (Formal)

 

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.