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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

How to reverse legend color order but keep the text order

Hi!

 

I'd like to reverse legend color order but keep the text order.

 

There are a few questions and solutions posted on this forum for sorting chart legends and creating custom sort order for them. However, I couldn't find one that solves the issue of reversing the legend color order.

 

Here's my table that contains the sales figure for each day.

j_you_0-1692252133539.png

 

I want to create a chart that shows the total sales for each month, using year as its legend. Here's the linechart:

j_you_2-1692252261999.pngj_you_1-1692252237668.png

 

QUESTION:

How can I reverese the legend colors so that the most recent year uses the color #1 and so on? That is,

2023 = light blue

2022 = dark blue

2021 = orange...

j_you_3-1692252365487.png

AND, keep the order of the legends (2019 left, 2023 right)?

 

Currently, I can achieve this by using my year_sort_order column. However, it will change the displayed legend order.

j_you_4-1692252547233.png

j_you_5-1692252697865.png

 

If I then sort the legends descending, the legends will revert back to their original colors.

j_you_6-1692252808709.png

j_you_7-1692252852793.png

 

 

 

 

 

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

 

I think you can custom your theme, you may refer to below offical blog to learn more details.

For reference: Use report themes in Power BI Desktop

Or you need to change the legend color in visual format as mlsx4 mentioned as above.

vrzhoumsft_0-1692696555861.png

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Thanks for the suggestion, I ended up reversing the theme colors. 

 

It's a shame that there isn't an option to sort chart legend colors by the legend value, independent from the legend value order. 

mlsx4
Memorable Member
Memorable Member

Hi @Anonymous 

 

If you want to keep the colours in that way for all the report, then you should modify your main theme once and you'll have it for everything. If you only want it for the graph, I think you will have to do it manually

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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