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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Samuel_Tavern
Frequent Visitor

Keeping the hierarchy grouping in clustered columns

Hello,

I have a Pivot Table in Excel with a 2-level hierarchy. Imanually re-arranged the rows in the Pivot table in order to have the groups ordered by the sum of values of the first level, and then ordered by the values of the second order:

Samuel_Tavern_0-1719413479435.png

I have the same data now available in Power BI and would like to recreate this chart. I have tried two approaches, both with non-satisfactory results:

  • Use the hierarchy on the X-axis and sort by count. The x-axis is then sorted by the values of the "second level", without taking into account the total value of the "first level".
  • Use small multiple to split the chart between the 3 categories of the first level. However for each small multiples all available vetagories of the second level are displayed, even if they do not contain any data. This made the chart very ugly.

What would be the way to display my data in the same way I did with the pivot table, without using to complicated DAX?

 

Here is the link to get the Power BI file with dummy data:

Sub Pareto Tests.pbix

And here is the link to get the wanted display with the same data, in Excel:

Sub Pareto Demo.xlsx

Thanks lot,
Samuel

 

 

1 ACCEPTED SOLUTION

Hi @Samuel_Tavern 

Unfortunately, there is no straightforward method for implementing nested sorting in charts.

It might be possible to achieve this using DAX.

I've attached a link to a discussion with a solution that was proposed a few months ago.

The discussion focuses on a cluster chart, but the underlying logic is applicable.

https://community.fabric.microsoft.com/t5/Desktop/Help-Needed-in-Nested-Sorting-for-Hierarchical-Bar...

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

3 REPLIES 3
Ritaf1983
Super User
Super User

Hi 
@Samuel_Tavern 

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Hi Ritaf1983,
Thanks for your answer. I have added links to the OneDrive versions of the PowerBI file and an Excel file with the example of what I want in my initial post.

 

Best regards,

Samuel

Hi @Samuel_Tavern 

Unfortunately, there is no straightforward method for implementing nested sorting in charts.

It might be possible to achieve this using DAX.

I've attached a link to a discussion with a solution that was proposed a few months ago.

The discussion focuses on a cluster chart, but the underlying logic is applicable.

https://community.fabric.microsoft.com/t5/Desktop/Help-Needed-in-Nested-Sorting-for-Hierarchical-Bar...

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors