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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
jader3rd
Microsoft Employee
Microsoft Employee

Keep the legend color between two charts the same

I have a report with two pie charts. One has 4 items in the Legend, the other has the 4 same items, plus one more. Given that the values in the two are different each legend series has different colors in the different charts. This is confusing because Series A in the left chart is blue, but in the right chart it is orange. I know that I can manually assign colors for legend/series values, but I'm hoping to find something more dynamic. A way to "link" the two charts together such that their color picking algorithm can assign the same color to the same series value.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@jader3rd 

Most of the chart does not support conditional formatting once a legend is taken. If it supports you can have color measure like this and use that

Color Date = if(FIRSTNONBLANK(Table[Cat],Blank()) = "Cat1","lightgreen","red")

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...

 

Check and  Vote for the Idea: https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/15540297-global-data-colors

 

The one you want is there in the idea

View solution in original post

3 REPLIES 3
priyanka_sarva
Regular Visitor

Hi amitchandak,

 

I have 2 pie charts with more than 50 suppliers and they pick different colour. I tried to fix manually but its very hectic and cant keep updating colours one by one. Please suggest some wayout.

amitchandak
Super User
Super User

@jader3rd 

Most of the chart does not support conditional formatting once a legend is taken. If it supports you can have color measure like this and use that

Color Date = if(FIRSTNONBLANK(Table[Cat],Blank()) = "Cat1","lightgreen","red")

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...

 

Check and  Vote for the Idea: https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/15540297-global-data-colors

 

The one you want is there in the idea

mahoneypat
Microsoft Employee
Microsoft Employee

In the format options for the pie chart, in the Data Colors area, you can set the color for each category.  So you can make them match up.

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

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