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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Kk6
Frequent Visitor

matrix table selected row change color

Hi, 

  I have a matrix table. if I select any one row. that particular row should be highlighted with any color.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Kk6 ,

To highlight a row in a Power BI matrix table based on a selection, please have a try.

1. Create a slicer that allows you to select a row value from the matrix table. For example, if your matrix table has a column called “Name”, you can create a slicer based on that column.

2. Create a measure that returns a color code based on the selected row value. For example, you can use this formula:

Highlight =
IF (
    HASONEVALUE ( 'Table'[Name] ),
    IF (
        SELECTEDVALUE ( 'Table'[Name] ) = MAX ( 'Matrix'[Name] ),
        "#FF0000",
        "#FFFFFF"
    ),
    "#FFFFFF"
)

This measure will return red if the selected row value matches the slicer value, and white otherwise.

3. 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. Select the measure you created as the based on field option.

4. Now, when you select a row value from the slicer, the corresponding row in the matrix table will be highlighted with red color.

Solved: Highlight one row in a table based on selection fr... - Microsoft Fabric Community

Highlight/change color of a clicked row in a table - Microsoft Fabric Community

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

I Want to change the row header background color. row background color no conditional formatting option in matrix visual. 

Kk6_0-1706089143472.png

I want to change the student no-gray, name-light gray, subject-very light gray . 

Kk6_1-1706089309959.png

No option available in the matrix visual in power bi row header.

 

Anonymous
Not applicable

Hi @Kk6 ,

To highlight a row in a Power BI matrix table based on a selection, please have a try.

1. Create a slicer that allows you to select a row value from the matrix table. For example, if your matrix table has a column called “Name”, you can create a slicer based on that column.

2. Create a measure that returns a color code based on the selected row value. For example, you can use this formula:

Highlight =
IF (
    HASONEVALUE ( 'Table'[Name] ),
    IF (
        SELECTEDVALUE ( 'Table'[Name] ) = MAX ( 'Matrix'[Name] ),
        "#FF0000",
        "#FFFFFF"
    ),
    "#FFFFFF"
)

This measure will return red if the selected row value matches the slicer value, and white otherwise.

3. 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. Select the measure you created as the based on field option.

4. Now, when you select a row value from the slicer, the corresponding row in the matrix table will be highlighted with red color.

Solved: Highlight one row in a table based on selection fr... - Microsoft Fabric Community

Highlight/change color of a clicked row in a table - Microsoft Fabric Community

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

Kk6
Frequent Visitor

below I mentioned my need...

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors