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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Ordering of Legends in Stack bar chart

Hi Friends,

I have created a stack bar chart. 

 

Blue color denotes to : High

Red color denotes to : Low

Yellow color denotes to : Medium

 

So current ordering is - High, Low, Medium [Ordered Alphabetically]

 

I want to order it like - High, Medium, Low. But I am not able to do so. 

 

Kindly help me out to make it done. Thanks a lot in advance.

 

bhuprakashs_0-1599296963724.png

 

Regards,

Bhu

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

Could you please provide some sample data which used in stacked bar chart in order to provide you a proper solution? If the data have the same structure with the one in below screen shot, you can put the Soil Type fields  in Values fields with specific orders just like the part with red mark.

Ordering of Legends in Stack bar chart.JPG

In addition, you can refer the method in the following links.

Modify the legend order

Custom sort order for axis, columns, legends.... in Power BI

Best Regards

Rena

View solution in original post

4 REPLIES 4
mussaenda
Super User
Super User

Hi @Anonymous,

 

you can create an index for your legend then use sort column by your index column.

 

2020_09_05_13_55_07_TC_BOM_v1_Power_BI_Desktop.png

 

Hope this helps.

Anonymous
Not applicable

Hi @mussaenda ,

Thanks for your revert.

But I have 3 columns in same table for different stages of Soil Type having High, Medium and Low.

I think your solution will work only for one column. Others 2 will be disordered by sorting index for 1st column.

Is there any other solution using that I can sort 3-4 charts in different stages ???

Thanks.

Anonymous
Not applicable

Hi @Anonymous ,

Could you please provide some sample data which used in stacked bar chart in order to provide you a proper solution? If the data have the same structure with the one in below screen shot, you can put the Soil Type fields  in Values fields with specific orders just like the part with red mark.

Ordering of Legends in Stack bar chart.JPG

In addition, you can refer the method in the following links.

Modify the legend order

Custom sort order for axis, columns, legends.... in Power BI

Best Regards

Rena

@Anonymous , You can use the same sort column for all three. But you need have a column like

 

Switch ( True(),

[Col1]="High",1,

[Col1]="Medium",2,

[Col1]="Low",3) // correct the numbers as per need

Step for sort column

https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column

 

Also, check, you might not need that

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in-power-bi

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.