Skip to main content

Power BI

Planned

Custom order for legend

Vote (5152) Share
Krishna Sankar's profile image

Krishna Sankar on 30 Jul 2015 05:43:14

I should be able to order the "legend" and the values for each legend category in a stacked bar chart. This is similar to "series order" feature in Excel

Administrator on 18 Oct 2022 00:54:14

Update 10/17: This is now in our upcoming roadmap and we will share more details in the coming months. Mo

Thanks for the feedback. Vote to keep updated on progress for this item.

Comments (344)
Krishna Sankar's profile image Profile Picture

Nedelina Tasheva on 30 Aug 2021 06:45:27

RE: Custom order for legend

Hi, 

It will be great to have this feature indeed. 
As a workaround I use the custom conditional columns.

You insert a new conditional column in the data table (I called it order by) 
Assign  a number for each value in the desired column(column A) for which you want to assign the custom order. If you have 10 values you want to put in specific order you use the number from  1 to 10.
Make sure your new column is with data type Number. Then close & apply the changes,
Select the column (Column A) to which you want to apply custom order,
Once you select the (Column A) on the top new tab Column tools will  appear
 Select sort by and select the new column with the assigned number for the values in your column
 It works well for me as a workaround to sort and order everything the way I want to. The downside is that it is manually maintained. 


Hope that helps, 
Best regards, 
Nedelina 

Krishna Sankar's profile image Profile Picture

Naomi van den Beukel on 27 Jul 2021 15:03:04

RE: Custom order for legend

How is simple functionality like this not yet a feature in Power BI? I keep running into imo pretty basic things that are simply not possible. Please add this ASAP!

Krishna Sankar's profile image Profile Picture

James Riley on 26 Jul 2021 17:09:22

RE: Custom order for legend

I agree with @Lisa Rea
There are two issues here. The "easiest" issue to solve should be matching the legend to the segmented bar colors. As Lisa points out, when you move the legend to the left or the right, the legend is now the OPPOSITE of the color order. How did the dev's at Microsoft not notice this?

This issue gets confused with "sorting the category order". There are plenty of workarounds for this using a "sort column". It would be nice to have a feature where you didn't have to resort to a workaround, but at least this is possible. You can custom sort all day, but the legend will still be backwards.

The issue of the legend order not matching the segment order does not have a solution yet.

Krishna Sankar's profile image Profile Picture

Lisa Rea on 26 May 2021 23:17:26

RE: Custom order for legend

As for the comment of "This can be done via Sort by Column already" that isn't the whole issue when it comes to stacked charts. Even with the column sort defined the legend order will not match the chart when you place the legend on either the left or right side. In these cases the legend order is the oposite of the stack order. For example, the bottom-most stack will be the top item in the legend list. So the issue, as I see it, is two-fold. First, allow an order that is manually defined and different from the default sort order for the column. Second, when placing the legend on either the left or right side the order of the legend should match the order of the stacks REGARDLESS of the defined sort order of the stacks themselves. Every tool I have used (Excel, Tableua, BO, etc.) has the legend order matching the stacks when the legend is positioned on the left or right

Krishna Sankar's profile image Profile Picture

David Hajdu on 21 May 2021 04:47:17

RE: Custom order for legend

This can be done via Sort by Column already

Krishna Sankar's profile image Profile Picture

Martin Lucas on 13 May 2021 11:07:10

RE: Custom order for legend

Need to be able to sort Legend by Value not just alphabetically

Krishna Sankar's profile image Profile Picture

Niloufar Mohaseb on 29 Apr 2021 21:14:07

RE: Custom order for legend

How many votes needed?

Krishna Sankar's profile image Profile Picture

Raluca Carmichael on 15 Apr 2021 15:50:13

RE: Custom order for legend

You should be able to order legend by wither draging the stacked bar portion and move it, or the legend itself. Why is this not a thing? I just had t go through a 30 min tutorial of creating relationships, new tables etc to be able to change the freaking order ? They should be changeable even from the format under data colours, just drag and move around. How can a company as rich as Microsoft have developers make a programme that is not intuitive. Can you tell I am frustrated?

Krishna Sankar's profile image Profile Picture

Fred Newton on 24 Mar 2021 15:45:33

RE: Custom order for legend

Add to that the ability to Wrap the legend, rather than having to page left/right to see the categorise that don't fit in the available width

Krishna Sankar's profile image Profile Picture

Ke Lo on 25 Feb 2021 16:42:13

RE: Custom order for legend

Any plan for this feature in 2021? This is really important for me, thanks.