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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

0

Stacked Columns in Bar Charts are not sorted in the same order as the Legend

I am still learning Power BI so maybe this is expected behavior but I think it is a bug. 

I am charting survey data and have added a calculated column to determine whether a response is negative or positive (-1/1).  I am using an index column to sort the Legend in my 100% stacked bar chart. The bars that have negative values are not being sorted in the same order as the legend as you can see in the screenshot below.  The X-axis is just a sum of the calculated column and is correctly representing the data. 

JTSpeaks_0-1657308400282.png

The problem persists when changing the chart to other stacked bar charts. I haven't been able to determine how the bars are being sorted or why.

JTSpeaks_1-1657309226328.png

 

Status: Delivered

Update:

We stack from zero, away from zero, like stacking blocks.

You have two series that are always negative, and two always positive, which is unique. If a series were to be sometimes positive or negative, there is no stacking algorithm that could guarantee colors are in the same order from left to right / top down. 

 

For example, using the image provided, look at red arrow - what if orange series was negative here? We cannot place it to the right of Blue, that's positive plot area.

 

Best Regards,
Community Support Team _ Yingjie Li

Comments
v-yingjl
Community Support
Status changed to: Accepted

Have submited this issue internal to confirm(ICM: 319760505), would update here as soon as possible if there is any progress about it.

 

Best Regards,
Community Support Team _ Yingjie Li

v-yingjl
Community Support
Status changed to: Delivered

Update:

We stack from zero, away from zero, like stacking blocks.

You have two series that are always negative, and two always positive, which is unique. If a series were to be sometimes positive or negative, there is no stacking algorithm that could guarantee colors are in the same order from left to right / top down. 

 

For example, using the image provided, look at red arrow - what if orange series was negative here? We cannot place it to the right of Blue, that's positive plot area.

 

Best Regards,
Community Support Team _ Yingjie Li

JT-Speaks
Regular Visitor

That seems counter intuitive.  When you go to the trouble of sorting a legend, you would expect that the bars would be sorted in the same order.  

 

I would like to submit this as a feature request.