Forum Discussion
Formatting two Column Headers in a Matrix table
- Anonymous1 year ago
Hi mmrisk ,
Power BI does not currently support individual column header colors and can only set a uniform color for all column headers.
But you can try the following workaround by using the measure header to replace the column header of a field.
Create the following measures to represent the values under different 'Risks'.
Low = CALCULATE( SUM('Table'[Value]), 'Table'[Risk] = "Low")Medium = CALCULATE( SUM('Table'[Value]), 'Table'[Risk] = "Medium")High = CALCULATE( SUM('Table'[Value]), 'Table'[Risk] = "High")Use these three measures as the value of the matrix.
Set the font color for the headers of each of the three measures.
In this way, the 'Status' column header color is black.
And the measure value header replaces the 'Risk' column header, which can be set to a different color.Please see the attaced pbix for referenece.
Best Regards,
Dengliang Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hey there!
You could try using Conditional Formatting with a Measure:
Power BI does not allow direct header formatting, but you can trick it by adding a dummy measure.
Create this DAX formula:
HeaderColor =
SWITCH(
SELECTEDVALUE(YourColumn),
"Deferred", "#FF0000", // Red
"Overdue", "#FF0000", // Red
"Low", "#000000", // Black
"Medium", "#000000", // Black
"High", "#000000", // Black
"#000000" // Default
)
Apply this measure to the "Text color" in conditional formatting under the Values section.
Hope this helps!
😁😁
Thank you for your help.
I couldn't get this to work as the Conditional Formatting for Font Color ( in Cell Elements) doesn't change the column headers, just the column values. And I couldn't find any other spots where I could add in this measure. In a matrix table, it seems the only place you can use conditional formatting in is the Values (per above) and the table Title.