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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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