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
HamidBee
Impactful Individual
Impactful Individual

How can I group the rows of these tables?

I am working with the following data:

 

NameValue
Makeshift (10)10
Central (5)34
Makeshift (20)66
Central (10)78
Central(5)26
Outer (19)87
Makeshift (30)40
Outer (19)49
Outer(13)45

 

I would like to plot the data on a bar chart but group the similar names together. So for exmample I would like to merge Makeshift (10), Makeshift (20) and Makeshift (30) together under the name Makeshift. I'd like to do the same for Outer and Central. After that I'd like to be able to drill down and actually show a detailed breakdown which will show Makeshift (10), Makeshift (20) and Makeshift (30). Does anyone have any ideas on how I can do this in Power BI Desktop?.

2 REPLIES 2
CNENFRNL
Community Champion
Community Champion

= Table.AddColumn(#"Changed Type", "Category", each Text.TrimEnd(Text.BeforeDelimiter([Name], "(")))

CNENFRNL_0-1660222553006.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

HamidBee
Impactful Individual
Impactful Individual

Thanks. Although I realised that some of the items I'm working with follow the pattern:

10 (Makeshift)

So when I use the M code above, it doesn't return a category name for these rows.

Assume I've plotted the bar chart for this. Name on X axis and Value on Y axis. How can I now drill down for each category so that I can see Name vs Value rather than just Category vs Value?. 

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.

Top Solution Authors