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
AllanBerces
Post Prodigy
Post Prodigy

Switch

Hi good day can anyone help me on my new column base from my table below, basically if the comments is Cancelled and Tobe- Cancelled the actual colunm should reflect Non-Workable.

AllanBerces_0-1730878957111.png

OUTPUT

AllanBerces_1-1730878991616.png

 

Thank you

2 ACCEPTED SOLUTIONS

Houstonho_1-1730881268347.png

Actual = SWITCH(Test[Comment], "Cancelled", "Non-Workable", "Tobe-Cancelled", "Non-Workable", Test[Status])

 

View solution in original post

PhilipTreacy
Super User
Super User

@AllanBerces 

 

Just add [Status] like this

 

 

Actual = 

SWITCH(

TRUE(),

[Comments] = "Cancelled" || [Comments] = "Tobe- Cancelled" , "Non-Workable",

[Status]

)

 

 

regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

6 REPLIES 6
PhilipTreacy
Super User
Super User

@AllanBerces 

 

Just add [Status] like this

 

 

Actual = 

SWITCH(

TRUE(),

[Comments] = "Cancelled" || [Comments] = "Tobe- Cancelled" , "Non-Workable",

[Status]

)

 

 

regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


PhilipTreacy
Super User
Super User

@AllanBerces 

 

What about the other values in the column like Not Started, Completed, In Progress?

 

You can use IF or SWITCH 

 

 

Column = IF([Comments] = "Cancelled" || [Comments] = "Tobe- Cancelled" , "Non-Workable")

 

 

 

Column = 

SWITCH(

TRUE(),

[Comments] = "Cancelled" || [Comments] = "Tobe- Cancelled" , "Non-Workable"

)

 

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Hi @PhilipTreacy thank you for the quick reply and for the Actual will copy the word is status column as long its not Cancelled and Tobe- Cancelled in comment column. 

Houstonho_0-1730881166296.png

Assumed the table named "Test", add a column with DAX,

Actual = SWITCH(Test[Comment], "Cancelled", "Non-Workable", "Tobe-Cancelled", "Non-Workable", Test[Comment])

Houstonho_1-1730881268347.png

Actual = SWITCH(Test[Comment], "Cancelled", "Non-Workable", "Tobe-Cancelled", "Non-Workable", Test[Status])

 

Hi @PhilipTreacy @Houston-ho thank you very much, working great.

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.