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
WishAskedSooner
Continued Contributor
Continued Contributor

Stacked Bar Chart Sort

HI Experts!

 

I have a horizontal stacked bar chart with two measures in the X-Axis well. However, when I try to sort the Total of the stacked bars, there is only the option to sort the indivdual measures. This leads to really screwed up visual.

 

What am I missing? Is there a way to sort on the Total of the two measures?

 

TIA!

1 ACCEPTED SOLUTION
QuentinGa
Resolver I
Resolver I

Hi @WishAskedSooner,

 

It's not possible, it's a limitation of Power Bi.

You can only sort by individual measures.

 

You can try this:

- Create a measure that sums your two measures: Total = [Measure1] + [Measure2]
- Add this measure to the Tooltips field well of your visual.
- Then click the three dots on the chart, go to Sort axis and select your new Total measure.

 

Let me know if it works.

View solution in original post

4 REPLIES 4
danextian
Super User
Super User

Hi @WishAskedSooner 

When multiple measures are used, sorting can only be applied to one measure at a time, not to all measures simultaneously. A common workaround is to use a disconnected table to materliaze the values of these measures using column values with a conditional formula, and then use that column as a legend. 

 

There are three measures in the example below, but only one is used in the visual - the one that's conditonally referencing them.

danextian_0-1770448978723.png

danextian_1-1770449055617.png

 

 

Please see the attached pbix.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
krishnakanth240
Super User
Super User

Hi @WishAskedSooner 

 

Can you try this adding a measure. From the settings we dont have the option to sort based on Total of two individual measures.

krishnakanth240_0-1770433148449.png

 

QuentinGa
Resolver I
Resolver I

Hi @WishAskedSooner,

 

It's not possible, it's a limitation of Power Bi.

You can only sort by individual measures.

 

You can try this:

- Create a measure that sums your two measures: Total = [Measure1] + [Measure2]
- Add this measure to the Tooltips field well of your visual.
- Then click the three dots on the chart, go to Sort axis and select your new Total measure.

 

Let me know if it works.

@QuentinGa ,

 

That actually works! Kudos!

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.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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