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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Saarek
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
mahimabedi
Responsive Resident
Responsive Resident

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
mahimabedi
Responsive Resident
Responsive Resident

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"

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.

 

 

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors