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
ajmonster
Helper II
Helper II

Order of Stacked Bar Chart

Hello

 

I have a stacked bar chart with a single bar and 5 different sections (values separated by legend). Depending on the set of data I've specified, the sections in the bar reorganize themselves depending on value. How can I stop that reordering?

 

Thanks,

ajmonster

3 REPLIES 3
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @ajmonster,

 

Below is the result in my test, actually, the legend order is sorted by legend items by default. The sections in the bar don't reorganize themselves depending on values. 

1.PNG

 

In your scenario, maybe the order based on value is precisely the same as order depending on legend items. If you want to customize the legend order, please see below steps:

 

Add a conditional column in query editor mode based on legend field.

2.PNG

 

In data view, change the default sorting.

3.PNG

 

Result.

4.PNG

 

Best regards,
Yuliana Gu

 

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

Hey @v-yulgu-msft,

 

If one of the sections value is negative, they will reorganize (even if you eliminate the x axis values in my case, or y axis in your case). I was hoping not to create a new column, but it seems that's the only option here.

 

Cheers,

ajmonster

Hi @ajmonster,

 

As you said, the column bar will take the negative/positive into account. It doesn't make sence to sort different sections only based on legend items, while ignore the actual values. As each section should display its value, corresponding to data point on Y-axis. 

 

I'm afraid your requirement cannot be achieved now.

 

Regards,
Yuliana Gu

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

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.