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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Conditional Formatting based on Brand name

Hi,

 

I have a table with Brand Names in rows and Dates in columns. There are around 30 brands, and new ones can be added along the way. In the table if the brand exists in a certain date, it is marked as Y. I want to colour the font a colour based on the brand name and Ys. The matrix visual should look something like this (this is a summary table, actually there are a lot more brands and dates):

 

 1/1/20211/2/20211/3/20211/4/20211/5/2021
Brand AYYY  
Brand B YYYY
Brand C   YY
Brand DYYY  

 

How do I do this conditional formatting? I have a table like this which identifies the hex code for each brand, but idk how to use it:

BrandColourHex
A#00CCFF
B#CCFFFF
C#CCFFCC
D#FFFF99
E#99CCFF
F#FF99CC
G#CC99FF
H#FFCC99
9#3366FF
10#33CCCC
11#99CC00
12#FFCC00
13#FF9900
14#FF6600
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

I created a sample pbix file for you(see attachment), please check whether that is what you want.

1. Create a measure to get the related color under different brand

Conditional formatting = 
CALCULATE (
    MAX ( 'Fontcolor format'[ColourHex] ),
    FILTER (
        'Fontcolor format',
        'Fontcolor format'[Brand] = SELECTEDVALUE ( 'Table'[Brand] )
    )
)

2. Create a matrix and set conditional formatting for Values field as the below screenshot

yingyinr_0-1624266353156.png

yingyinr_1-1624266546565.png

Best Regards

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

I created a sample pbix file for you(see attachment), please check whether that is what you want.

1. Create a measure to get the related color under different brand

Conditional formatting = 
CALCULATE (
    MAX ( 'Fontcolor format'[ColourHex] ),
    FILTER (
        'Fontcolor format',
        'Fontcolor format'[Brand] = SELECTEDVALUE ( 'Table'[Brand] )
    )
)

2. Create a matrix and set conditional formatting for Values field as the below screenshot

yingyinr_0-1624266353156.png

yingyinr_1-1624266546565.png

Best Regards

amitchandak
Super User
Super User

@Anonymous , make sure this table it joined with brand you are using or part of the brand table

 

create a measure max(brandcolor[ColourHex]) and use that is conditional formatting using field value option

 

 

or measure like

 

maxx(filter(brandcolor, brandcolor[ColourHex] =max(Table[Brand])),brandcolor[ColourHex])

 

How to do conditional formatting by measure and apply it on pie?: https://youtu.be/RqBb5eBf_I4

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.