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.
- Anonymous6 years agoNot applicable
V-lianl-msft Here is my pbix file. All of the colors are not working.
when there are no hours the background should be pink. Also, it is only shading saturdays not sundays. please let me know if you can access the file, if not please send me an email address. Thanks a lot for your hel
- V-lianl-msft6 years agoCommunity Support
Hi Anonymous ,
Unfortunately, we are performing conditional formatting on "work hours" and can only judge when "work hours" has value.
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.