Forum Discussion
matrix table selected row change color
- Anonymous3 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 _ RongtieIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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.
- Kk62 years agoFrequent Visitor
below I mentioned my need...