Forum Discussion
coyote_ptm
5 years agoFrequent Visitor
Conditional formatting on dimension attribute
I have seen similar posts regarding this, but they don't seem to be usable in my scenario. I'd like to format a measure with different background colors based on an attribute from a dimension table. ...
amitchandak
5 years agoSuper User
coyote_ptm , You need to use related, relatedtable of MAXX to filter and bring that in a new calculated column
refer 4 ways to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8
- coyote_ptm4 years agoFrequent Visitor
Following up. I brought the Target Ratio into the LaborHours table.
New column:
Target Ratio = LOOKUPVALUE( Employees[ Target Ratio], Employees[Employee], LaborHours[Employee] )Created Average measure of target ratio:
Target Ratio Measure = AVERAGE( LaborHours[Target Ratio] )/100This was the issue for me - I didn't create this as a measure and it didn't work. It would always be 1 color because it was comparing to each row in the fact table, not the sum of the fact table.
Met Charge Color = IF( LaborHours[Charge Ability PCT] == 0, "#FFFFF", IF( LaborHours[Charge Ability PCT] < LaborHours[Target Ratio Measure] , "#FF7C80" , "#A9D08E" ) )It's too bad it couldn't just use the ratio from the employee table without adding to labor hours table, but this works for now.