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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
jader3rd
Employee
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
Employee
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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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