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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

sort the values in a stacked bar chart by descending order?

Hi there,

 

I am desperatly trying to sort the values in a stacked bar chart by descending order. In the example below of GDP by country, I would like to have the USA values at the bottom of the chart, followed by China etc. how is this possible?

 

I tried using the sorting option in the settings on the top right of the chart but in only sorts the columns not the stacks.

 

thanks in avdance.

ss

2 REPLIES 2
v-lid-msft
Community Support
Community Support

Hi @Anonymous ,


How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?

 

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-lid-msft
Community Support
Community Support

Hi @Anonymous ,

 

Since Power BI orders the legend alphabetically, We can create a calculated column as a legend to meet your requirement:

 

RankLegend =
RANKX ( 'Sales 2015', [CountryRegion],, DESC, DENSE ) & " " & [CountryRegion]

9.PNG

 

Please refer to the similar threads: https://community.powerbi.com/t5/Desktop/Modify-the-legend-order/td-p/25337


BTW, pbix as attached.

 

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors