cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
capalt
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"

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
November 2022 Update

Check it Out!

Click here to read more about the November 2022 updates!

Microsoft 365 Conference â__ December 6-8, 2022

Microsoft 365 Conference - 06-08 December

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.