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
jt_123
New Member

Can you highlight values in a matrix in PBI based on a different column?

Hi everyone,

 

I'm looking to see if its possible to highlight a matrix in Power BI as per the following:

 

I need to highlight a 'qty' column' based on the corresponding supplier column with different colours for each supplier.

I'd like to avoid adding a drill down row and instead use a quick colour visual like this:

Good result:

jt_123_0-1737144177309.png

 

Would like to avoid needing to drill down:

jt_123_1-1737144230220.png

 

Example Table: 

ItemQtySupplierDate
A21312025-01-05
B57622025-01-06
C546332025-01-10
D3442025-01-14
E6752025-01-04
1 ACCEPTED SOLUTION
v-heq-msft
Community Support
Community Support

Hi @jt_123 ,
Thanks for Greg_Deckler reply.
You can create a measure

Color = 
IF(
    ISFILTERED('Table'[Item]) && NOT ISFILTERED('Table'[Supplier]),
    SWITCH(
        TRUE(),
        SELECTEDVALUE('Table'[Supplier]) = 1,"Green",
        SELECTEDVALUE('Table'[Supplier]) = 2,"Red",
        SELECTEDVALUE('Table'[Supplier]) = 3,"Blue",
        SELECTEDVALUE('Table'[Supplier]) = 4,"Purple",
        SELECTEDVALUE('Table'[Supplier]) = 5,"Yellow"
    ),
    "#RRGGBB00"
)

Apply the meausre to conditonal formating of Background color

vheqmsft_1-1737338089811.png

vheqmsft_2-1737338136204.png

 

 

Final output

vheqmsft_0-1737338060648.png

vheqmsft_3-1737338152650.png

 

Best regards,
Albert He


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

(Virus scan in progress ...)
2 REPLIES 2
v-heq-msft
Community Support
Community Support

Hi @jt_123 ,
Thanks for Greg_Deckler reply.
You can create a measure

Color = 
IF(
    ISFILTERED('Table'[Item]) && NOT ISFILTERED('Table'[Supplier]),
    SWITCH(
        TRUE(),
        SELECTEDVALUE('Table'[Supplier]) = 1,"Green",
        SELECTEDVALUE('Table'[Supplier]) = 2,"Red",
        SELECTEDVALUE('Table'[Supplier]) = 3,"Blue",
        SELECTEDVALUE('Table'[Supplier]) = 4,"Purple",
        SELECTEDVALUE('Table'[Supplier]) = 5,"Yellow"
    ),
    "#RRGGBB00"
)

Apply the meausre to conditonal formating of Background color

vheqmsft_1-1737338089811.png

vheqmsft_2-1737338136204.png

 

 

Final output

vheqmsft_0-1737338060648.png

vheqmsft_3-1737338152650.png

 

Best regards,
Albert He


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

 

 

(Virus scan in progress ...)
Greg_Deckler
Super User
Super User

@jt_123 I would create a measure that returns the appropriate color codes, "#000000" based upon the MAX('Table'[SupplierDate]). You could then use that with the Field value option for conditional formatting.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements