cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AmiraBedh
Super User
Super User

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"


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696
1 ACCEPTED SOLUTION
amirabedhiafi
Impactful Individual
Impactful Individual

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
Impactful Individual
Impactful Individual

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
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Top Solution Authors