Forum Discussion
Matrix: No conditional formatting for rows?
- 8 months ago
Hi sasdfasdfsad
You're request isn't entirely clear. You say you have rows Customer Name, Status, Phone, Address, but then you say Status is a column, so I'm not sure what your data or matrix look like.
I'm going to proceed using this data
Create a measure that will decide on the color of the Status field
Measure = VAR _status = SELECTEDVALUE(Data[Status]) RETURN SWITCH( _status, "Bad" , "#FF0000", // Add other Status strings + Hex color codes here "" )Select the Conditional Formatting -> Background color for the Status
Use these settings for the Conditional Formatting rule
If you want to apply this formatting to the entire row, apply the same rule to each of the fields/columns
Regards
Phil
- 8 months ago
Hi sasdfasdfsad
If you're referring to the categories, the dimensions that split matrix into columns and rows, those do not support conditional formatting. Only the fields in the value tiles can be conditionally formatted.
- 8 months ago
Hi sasdfasdfsad , Thank you for reaching out to the Microsoft Community Forum.
ChandraTeja , PhilipTreacy , Kedar_Pande are correct about the key Power BI limitation you’re hitting, a text field placed in the Rows area of a Matrix cannot be conditionally formatted. Power BI only allows background or font colour rules on fields that live in the Values well, so trying to format Status directly in the row headers simply won’t show any options. danextian 's clarification aligns with this, only values can be formatted and Idrissshatila is right that true row header colouring still isn’t supported today.
What does work is shifting the formatting job to a measure in Values. The simple pattern is to create a measure that returns a colour based on the current Status, then add a tiny placeholder measure into Values and apply conditional formatting to it using Format style: Field value, pointing it at your colour measure. Once you hide the placeholder’s text and place it beside the Status row, you get the visual effect you wanted even though the Status field itself can’t be formatted.
Thank you danextian , Kedar_Pande , PhilipTreacy , Idrissshatila & ChandraTeja for your valuable responses.
sasdfasdfsad
You can't apply conditional formatting directly to text fields in the Rows header section of a Matrix, but there's a workaround using a measure in the Values bucket.
DAX Measure 1 (Color Code): Create a measure that uses SWITCH(TRUE(), ...) based on MAX('YourTable'[Status]) to return a specific HEX Color Code (e.g., #FF0000).
DAX Measure 2 (Placeholder): Create a simple measure, like Placeholder_Value = 1.
Matrix Setup: Put the Placeholder_Value into the Values well.
Formatting: Apply Conditional formatting (Background/Font Color) to the Placeholder_Value. Choose Format style: Field value, and base it on your Color Code Measure.
Clean Up: Hide the '1' value (by setting its font color to match the background color) and position the placeholder column right next to your Status column.
This effectively creates a colored "shadow column" that acts as your conditional formatting.