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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

Applying colour codes to a data set to apply to multiple graphs

As a newer user of Power BI i am have multiple charts showing data for a number sales products.  I want to apply a corporate colour for each product so that it is the same on every graph.  I know how to do this individually chart by chart but there must be a better way to do this, but cant work out how to do it.  I already have hex colour codes etc.

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

You can create a measure and apply it to the conditional formatting of the data color.

Measure = SWITCH(TRUE(),
                MAX('Table'[Product])="A","RED",
                MAX('Table'[Product])="B","LIME",
                MAX('Table'[Product])="C","YELLOW",
                MAX('Table'[Product])="D","GREEN",
                MAX('Table'[Product])="E","GREY",
                MAX('Table'[Product])="F","BLACK",
                MAX('Table'[Product])="G","PINK",
                "BLUE"
)

conditional formatting_2.PNGCapture2.PNG

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

View solution in original post

3 REPLIES 3
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

You can create a measure and apply it to the conditional formatting of the data color.

Measure = SWITCH(TRUE(),
                MAX('Table'[Product])="A","RED",
                MAX('Table'[Product])="B","LIME",
                MAX('Table'[Product])="C","YELLOW",
                MAX('Table'[Product])="D","GREEN",
                MAX('Table'[Product])="E","GREY",
                MAX('Table'[Product])="F","BLACK",
                MAX('Table'[Product])="G","PINK",
                "BLUE"
)

conditional formatting_2.PNGCapture2.PNG

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

amitchandak
Super User
Super User

Anonymous
Not applicable

Not sure this answers my question.  I am not trying to change the background and foreground but define what is in my data as "Products" with set colours in a graph and i have around 20 products.  So if a product is called Product "A" i always want the graph to show a set colour and if Product "B" another colour.  How do you define for each product the exact colour to want applied.  Thanks

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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