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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! 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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors