Forum Discussion
Matrix-Conditional formating based on another field
V-lianl-msft Sorry, this is not working for me, maybe something I am doing wrong .
I need to color code the background color for work hours based on the categorydesc field.
Labor - Daily - green
Labor - Hourly - green
Labor - Salary - green
Vacation - orange
Holiday - black
When the work hours are 0 or no value the color should be pink.
When the date falls on a weekend that entire column should be yellow regardless if hours are reported.
Please see my sample. I do not know how to save this in a clound service.
Hi Anonymous ,
Based on the sample data you provided, I get the result you expect.
Measure = SWITCH(TRUE(),
WEEKDAY(MAX(Sheet1[weekdate]),2)in{6,7},"yellow",
MAX(Sheet1[hours])=0||ISBLANK(MAX(Sheet1[hours])),"pink",
MAX(Sheet1[categorydesc ])="Holiday","black",
MAX(Sheet1[categorydesc ])="Vacation","orange",
MAX(Sheet1[categorydesc ])="Labor - Daily","green",
MAX(Sheet1[categorydesc ])="Labor - Hourly ","green",
MAX(Sheet1[categorydesc ])="Labor - Salary","green",
"white")Here is the sample pbix
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.