Forum Discussion
Color Individual rows in Power BI matrix
I'm not sure replying to a post from 2017 is going to get you the best answer but I'll post this here in case it helps.
The basic pattern I follow is...
Create a measure with your rules that defines the colour you want. (adjust to suit your data)
Colour =
VAR v =
SELECTEDVALUE ( 'Table'[Column1] )
RETURN
SWITCH (
TRUE (),
v = "a", "rgba(255,100,10,1)",
v = "b", "rgba(10,10,255,1)",
v = "g", "rgba(10,255,10,1)",
v = "r", "rgba(255,10,10,1)"
)
Right click on the value/measure in the fields of your matrix and select 'Conditional Formatting' >> 'Background Colour' (or whichever formatting option you want).
Choose field value and your colour measure.
Hope this helps.
Hi KNP
Thanks for your quick reponse
The requirement is I have to show color coding( Conditional Formatting) for the Single row where I have dates ( in row section ).Here the logic is the row (say project) which has the dates less than current date I have to show RED color .
Power bi facilitates Conditional Formatting only for the values section.
So I want color code for the sinle row in row section.
Thank You KNP
- KNP4 years agoSuper User
Makes sense, I don't think what you need is currently possible. Also mentioned here...
- Anonymous4 years agoNot applicable
Again Thank KNP
Do You have any alternate solution?- KNP4 years agoSuper User
The best alternative, which in most cases isn't an option, is to use the Table visual instead of the Matrix visual. This gives you more control over the formatting.
One other possibility, check the maketplace to see if there are any custom visuals that could work. Here's one possibility. I've never used it but the reviews look good.
https://appsource.microsoft.com/en-us/product/power-bi-visuals/WA200000642