cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
capalt
Advocate II
Advocate II

Transform flag columns to text values in DAX

I have a flag column in a fact table sales which is :

  • 0 : disabled
  • 1 : enabled

I want to have another column based on the previous one where I will change the data mapping like below :

0 : becomes "disabled"

1 : becomes "enabled"

1 ACCEPTED SOLUTION
amirabedhiafi
Solution Supplier
Solution Supplier

You can create a calculated column like below : 

Flag_Column_Transformed =

SWITCH (

SELECTEDVAUE (yourTable[Flag_Column]),

0, "Disabled",

1, "Enabled")

)

Amira Bedhiafi
Full Stack Business Intelligence Consultant @Capgemini

View solution in original post

1 REPLY 1
amirabedhiafi
Solution Supplier
Solution Supplier

You can create a calculated column like below : 

Flag_Column_Transformed =

SWITCH (

SELECTEDVAUE (yourTable[Flag_Column]),

0, "Disabled",

1, "Enabled")

)

Amira Bedhiafi
Full Stack Business Intelligence Consultant @Capgemini

Helpful resources

Announcements
September Update

Check it Out!

Click here to learn more about the September 2022 updates!

Power BI Show Episode 10 Recap

The Power BI Community Show

Watch the playback when Amit Chandak, a Power BI Super User, demos how to use Field Parameters to make reports more dynamic.

Power BI Dev Camp Session 26

New Date - Check it Out!

Mark your calendars and join us on Thursday, October 6 at 11a PDT for a great session with Ted Pattison!

Health and Life Sciences Power BI User Group

Health and Life Sciences Power BI User Group

Power BI specialists at Microsoft have created a community user group where customers in the provider, payor, pharma, health solutions, and life science industries can collaborate.

Top Solution Authors