cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

Sort by legend on stacked bar chart

I've looked at numerous posts on here and other sites, but their charts seem a load more complicated than mine.

I can't even believe that this is a problem, I'm sure there must be something insanely simple that I am just missing!

 

I have a very simple stacked bar chart made up of just three items:

 

Axis is Account Period (think of this as months)

Legend is Status

Value is Actual Premium

 

Capture.JPG

 

All I want to do is change the order of the Legend, but I cannot find an option anywhere to do this. Now I know that Power BI likes to leave blindingly obvious feautures that every other BI suite on this planet has built in by default, but surely there is a simple tick box or something somewhere that I am just being a fool and missing?

2 ACCEPTED SOLUTIONS
Post Patron
Post Patron

You can change the sort individually for a legend. However Power BI will pick up the sorting logic defined for the column in the data model. The default is alphbetical. To change it

1. you would need another sort column in your table  i.e"sorting logic" (1,2,3...) 

2. then set the sort setting for your column to sort  by the column "sorting logic"

 

This will change the sort order for the column across the data model, hence also be applied to the legend.

More details here:https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-sort-by-column#:~:text=Power%20BI%2....

 

Another quick fix: What you could do is change the value to add numbers that will change the sort. Example "1. Secured" "2. Potential"

View solution in original post

I found this video on YouTube that really simplified the steps needed.

 

https://www.youtube.com/watch?v=4xapOrfLvbg

 

Thanks once again for your reply, put me on the right track.

 

 

View solution in original post

3 REPLIES 3
Post Patron
Post Patron

You can change the sort individually for a legend. However Power BI will pick up the sorting logic defined for the column in the data model. The default is alphbetical. To change it

1. you would need another sort column in your table  i.e"sorting logic" (1,2,3...) 

2. then set the sort setting for your column to sort  by the column "sorting logic"

 

This will change the sort order for the column across the data model, hence also be applied to the legend.

More details here:https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-sort-by-column#:~:text=Power%20BI%2....

 

Another quick fix: What you could do is change the value to add numbers that will change the sort. Example "1. Secured" "2. Potential"

View solution in original post

I found this video on YouTube that really simplified the steps needed.

 

https://www.youtube.com/watch?v=4xapOrfLvbg

 

Thanks once again for your reply, put me on the right track.

 

 

View solution in original post

Thanks @mahimabedi I had hoped that there would be a simple gui based option, but I'm finding that with Power BI a lot of really simple stuff seems to need work arounds to make it work.

 

Using your advice and piecing together other articles I've worked it out.

Helpful resources

Announcements
secondImage

Happy New Year from Power BI

This is a must watch for a message from Power BI!

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors