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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
StraighterSwing
Regular Visitor

How can I combine multiple row values into 1

Newbie here.   I have a table that has an ApptStatus column.  Among others, there are 3 that start with "Cancelled....". 

  1. Cancelled by Client
  2. Cancelled By Vendor
  3. Cancelled Due To Technical Issues

How can I combine\sum these into 1 value called "All Cancelations" so the BarChart only has 1 bar for this instead of 3 separate ones?

1 ACCEPTED SOLUTION
MNedix
Solution Supplier
Solution Supplier

Hi,

"Use the Switch young Jedi". Joke aside, create a new column as follows:

New Status = SWITCH(
TRUE(),
Table[ApptStatus] = "Cancelled by Client", "All Cancellations",
Table[ApptStatus] = "Cancelled by Vendor", "All Cancellations",
Table[ApptStatus] = "Cancelled Due To Technical Issues", "All Cancellations",
Table[ApptStatus])

 

If this answered your question, please mark it as the solution.

View solution in original post

3 REPLIES 3
StraighterSwing
Regular Visitor

I wish I could accept both answers as the solution as both worked great.  I also learned a lot about PowerBI with just these 2 responses.  I did upvote both answers though. 

Ashish's response was concise and simple and 100% functional (thank you!).  However, I selected MNedix's response as it too was 100% functional, but seems to be more versatile and flexible for other uses.  Also, even though there was a working answer, MNedix offered an additional alternative answer and didn't really have to.

 

Thank you to the both of you!

Ashish_Mathur
Super User
Super User

Hi,

Write this calculated column formula

Column = if(containsstrng(Data[AppStatus],"Cancelled"),"All cancellations",blank())

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
MNedix
Solution Supplier
Solution Supplier

Hi,

"Use the Switch young Jedi". Joke aside, create a new column as follows:

New Status = SWITCH(
TRUE(),
Table[ApptStatus] = "Cancelled by Client", "All Cancellations",
Table[ApptStatus] = "Cancelled by Vendor", "All Cancellations",
Table[ApptStatus] = "Cancelled Due To Technical Issues", "All Cancellations",
Table[ApptStatus])

 

If this answered your question, please mark it as the solution.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.