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
barce5
Frequent Visitor

Change Background Color of Selected Row in Power BI Matrix

Hi.  Does anyone know if it is possible to change the background color of a selected row in a matrix in Power BI?  It gives this light gray color and it is getting lost for my end users. I searched and can't seem to find a way to do this. TIA

1 ACCEPTED SOLUTION
AmiraBedh
Super User
Super User

You need a slicer that allows you to select a row value from the matrix table. If your matrix visual has a column ColA, you can create a slicer based on that column.

Then you need a measure to return the color code you want based on the selected row value, in your case light gray :

Highlight =
IF (
    HASONEVALUE ( 'Table'[Name] ),
    IF (
        SELECTEDVALUE ( 'Table'[Name] ) = MAX ( 'Matrix'[Name] ),
        "#D3D3D3",  -- light grey color
        "#FFFFFF"
    ),
    "#FFFFFF"
)

 

Apply this measure to the background color of the matrix table using conditional formatting by field value. You can do this by selecting the matrix table, clicking on Format, and then Conditional formatting. Choose Background color and then select Field value as the format by option.

 

You may need to apply this to all the columns used in your visual.

https://community.fabric.microsoft.com/t5/Desktop/matrix-table-selected-row-change-color/td-p/342823....

 


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

View solution in original post

2 REPLIES 2
AmiraBedh
Super User
Super User

You need a slicer that allows you to select a row value from the matrix table. If your matrix visual has a column ColA, you can create a slicer based on that column.

Then you need a measure to return the color code you want based on the selected row value, in your case light gray :

Highlight =
IF (
    HASONEVALUE ( 'Table'[Name] ),
    IF (
        SELECTEDVALUE ( 'Table'[Name] ) = MAX ( 'Matrix'[Name] ),
        "#D3D3D3",  -- light grey color
        "#FFFFFF"
    ),
    "#FFFFFF"
)

 

Apply this measure to the background color of the matrix table using conditional formatting by field value. You can do this by selecting the matrix table, clicking on Format, and then Conditional formatting. Choose Background color and then select Field value as the format by option.

 

You may need to apply this to all the columns used in your visual.

https://community.fabric.microsoft.com/t5/Desktop/matrix-table-selected-row-change-color/td-p/342823....

 


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Thank you for getting back to me so fast.  Unfortunately I am using the matrix with data as a slicer for other visuals since real estate is so valuable on the screen.  It looks like my only solution would be to put in another slicer that takes up space.  Ugh.  I was hoping there was another way around that.  Thanks so much 🙂 

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.