Forum Discussion
Conditional Formatting in a Matrix Visual.
Thanks, this helps a lot! My biggest concern is this is just a small sampling of data, and our Qty Available is dynamic and can change from month to month. For example, One month it may be 3, the next month it may be 4. Is there a way to account for that instead of creating a calculation for each indivual line item, and having that reference that for each?
Hi JBF1978 ,
Of course, I can further explain the implementation logic of the above code, the first level of switch statement is used to go for matching different item names, that is to say, if there are different measures for different items, this level is used for matching. The second level of switch is used to construct the rubric to set the color.
According to your description, if all items use the same judging criteria, you can use the following measure
Color =
SWITCH(
TRUE(),
'Table'[PreviousWeekOutput] >= 3,"Green",
'Table'[PreviousWeekOutput] = 2, "Yellow",
'Table'[PreviousWeekOutput] < 2, "Red"
)
For 2 and 3 I have hard coded them here, you can create a separate table of available quantities and then use measure to extract dynamic available quantity criteria to replace 2 and 3. This will enable you to measure these data against different available quantity criteria for each month.
Best regards,
Albert He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly