Forum Discussion

Kk6's avatar
Kk6
Frequent Visitor
3 years ago
Solved

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.

  • Anonymous's avatar
    Anonymous
    3 years ago

    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.

3 Replies

  • Anonymous's avatar
    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's avatar
      Kk6
      Frequent Visitor

      below I mentioned my need...

       

  • Kk6's avatar
    Kk6
    Frequent Visitor

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

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

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