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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Gerri
Frequent Visitor

Sort legend for stacked column chart

I'm trying to sort the legend by a custom order and looked at past tutorials to create the sort table and sort index.

But when I try to sort the legend for the stacked chart, it still sorts the legend by alphabetical order.

Am I missing a step somewhere?

 

Sample data and the stacked chart:

Gerri_0-1655107977168.png

Relationships between the tables:

Gerri_1-1655108089624.png

 

Table sorted by column sort order:

Gerri_2-1655108224475.png

 

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @Gerri ,

 

Add the sort order column to tooltip field, then you should be able to sort the visual by that column.

 

Best Regards,

Jay

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

View solution in original post

8 REPLIES 8
v-jayw-msft
Community Support
Community Support

Hi @Gerri ,

 

Add the sort order column to tooltip field, then you should be able to sort the visual by that column.

 

Best Regards,

Jay

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

Sorted! Thanks for your help!

Gerri_0-1655426624819.png

 

mohammedadnant
Impactful Individual
Impactful Individual

Hi @Gerri 

 

You need to use the feature of SORT BY COLUMN, pls see below image

mohammedadnant_0-1655117125321.png

 

 

Thanks & Regards,

Mohammed Adnan

Learn Power BI: https://www.youtube.com/c/taik18

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

Thanks & Regards,
Mohammed Adnan
Learn Power BI: https://www.youtube.com/c/taik18

Hi @mohammedadnant ,

I did use SORT BY COLUMN but it doesn't affect the visual.

Gerri_1-1655167535440.png

 

 

Hi @Gerri 

 

Can you try to select ascending/descending in the legend of this visual

mohammedadnant_0-1655182553682.png

 

 

Thanks & Regards,

Mohammed Adnan

Learn Power BI: https://www.youtube.com/c/taik18

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

Thanks & Regards,
Mohammed Adnan
Learn Power BI: https://www.youtube.com/c/taik18

Hi @mohammedadnant ,

With the legend of this visual selected:

Gerri_0-1655185205900.png

With the legend of this visual not selected:

Gerri_1-1655185289183.png

The strange thing is that I have no problems with the legend if it was a pie chart..

Gerri_2-1655185520255.png

 

Gerri
Frequent Visitor

Hi @mohammedadnant ,

Is there any solution for the visual to sort by the custom sort order? I've tried rebuilding my visual but the legend won't sort by the custom order if it's a column chart..

Hi @Gerri 

 

Please share the sample to test.

 

Thanks & Regards,

Mohammed Adnan

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

Thanks & Regards,
Mohammed Adnan
Learn Power BI: https://www.youtube.com/c/taik18

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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