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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
zpaul_010
Helper I
Helper I

How to reverse bar of Stacked column chart?

How to reverse bar of Stacked column chart?

I prefer the "yes" (shaded) to be at the bottom so I can make a percentage calculation target line at the bottom.

Capture4.PNG

 

 

 

 

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey,

 

the order of the segments in a stacked column depends of the sequence of the segments.

By default this sequence (sort order) is derived from the name of the members (used as legend), from the root of yaxis (0) an element named "A" is at the bottom and an element named "Y" is at the top. To change this sequence, you have to change the sortoder. This can be done more or less very easily:

 

Default sequence of segment in the stacked bar column chartbase.png

 

Go to the model tab of mark the column where you want to change the sequence and assign a column that contains an index value representing the sortorder (this can be achieved by an DAX satement to create an calculated column like this

 

SortOrderStatus = IF('Table2'[status] = "yes", 1, 2)

sort by column.png

 

Done!

ordered.png

 

Done!

 

Hope this helps

 

Regards

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

4 REPLIES 4
TomMartens
Super User
Super User

Hey,

 

the order of the segments in a stacked column depends of the sequence of the segments.

By default this sequence (sort order) is derived from the name of the members (used as legend), from the root of yaxis (0) an element named "A" is at the bottom and an element named "Y" is at the top. To change this sequence, you have to change the sortoder. This can be done more or less very easily:

 

Default sequence of segment in the stacked bar column chartbase.png

 

Go to the model tab of mark the column where you want to change the sequence and assign a column that contains an index value representing the sortorder (this can be achieved by an DAX satement to create an calculated column like this

 

SortOrderStatus = IF('Table2'[status] = "yes", 1, 2)

sort by column.png

 

Done!

ordered.png

 

Done!

 

Hope this helps

 

Regards

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Go to the model tab of mark the column where you want to change the sequence and assign a column that contains an index value representing the sortorder (this can be achieved by an DAX satement to create an calculated column like this

 

SortOrderStatus = IF('Table2'[status] = "yes", 1, 2)

 

 

Hey Tom,

 

I am trying my very hardest to get through this step of the process. Would you mind explaning this step a bit further?  I have 4 different data types that I need to sort through and am lost as to where to put this particular function. It would be very appreciated.

Thanks Tom. This worked! 

lbarreiro
Regular Visitor

Hello!!

 

I'm a new user in pbi. If I have understood your question, I believe that you have to change the order in value.

I hope help you.

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.