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

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
Power_Krille
Regular Visitor

Change sort order of Legends made by metrics in a stacked column chart

Hi

 

I have made 7 metrics that i just inserted in a stacked column chart and the bars has the right sortorder, but how do i change the sortorder of the legends. I want the legends mirror the sortorder of the bars. 

 

Power_Krille_0-1637229115928.png

I have tried to invert the Y axis but it doesn´t look so nice then;

 

Power_Krille_1-1637229220005.png

Is this possible to fix?

4 REPLIES 4
Anonymous
Not applicable

Hi  @Power_Krille ,

I created some data:

vyangliumsft_0-1637739963500.png

The visual objects presented are:

vyangliumsft_1-1637739963506.png

Custom rules:

I want to sort in reverse order

Here are the steps you can follow:

1. Enter the power query, click Table, and then click Copy to form New.

vyangliumsft_2-1637739963534.png

2. Click the remaining two columns, right-click, and select Remove Columns.

vyangliumsft_3-1637739963536.png

3. Click on the only column [group], and click Remove Duplicates.

vyangliumsft_4-1637739963537.png

4. Click Add Column – Colun From Examples – From ALL Columns.

vyangliumsft_5-1637739963539.png

Assign values in the order you want, here is the reverse order

vyangliumsft_6-1637739963540.png

5. Form New Table, click [group] column, Column tools – Sort by column – [Custom]

vyangliumsft_7-1637739963545.png

6. Result:

vyangliumsft_8-1637739963547.png

Best Regards,

Liu Yang

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

 

Hi

 

Yes but that didn´t help because then the order of the bars was changed, now you can see that A is in the top of the bar, it should be in the bottom as it was in your first picture. I don´t want that the order of the bar should change only the legend.

Power_Krille
Regular Visitor

Hi

 

That was a quick reply.... :-), but i don´t have that option and i think that is because i don´t have legend set;

Power_Krille_0-1637229768486.png

So that will not work for me. 

amitchandak
Super User
Super User

@Power_Krille , From nov 2021, onward there is an option given

https://powerbi.microsoft.com/en-us/blog/power-bi-november-2021-feature-summary/#post-17912-_Toc8747...

 

a legend sort can also be changed using a sort column

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.