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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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