Forum Discussion
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....".
- Cancelled by Client
- Cancelled By Vendor
- 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?
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.
3 Replies
- MNedix
Solution Sage
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.
- Ashish_Mathur
Super User
Hi,
Write this calculated column formula
Column = if(containsstrng(Data[AppStatus],"Cancelled"),"All cancellations",blank())
Hope this helps.
- StraighterSwingRegular 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!