Forum Discussion
Create Measure for Conditional Formatting Categorical values
Hi, Anonymous
You can count three conditions and then choose colors according to your needs (Prioritize late and blank conditions).
Like this:
Measure =
//VAR ontime = COUNTX ( FILTER ( 'Table', [On Time] = "On Time" ), [On Time] )
VAR late =
COUNTX ( FILTER ( 'Table', [On Time] = "Late" ), [On Time] )
VAR blankontime =
COUNTX ( FILTER ( 'Table', [On Time] = BLANK () ), [On Time] )
RETURN
IF ( late <> 0, "Red", IF ( blankontime <> 0, "Grey", "Blue" ) )
Select 'field value' in conditional format.
Like this:
Did I answer your question? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.
Best Regards,
Community Support Team _ Janey
- Anonymous4 years agoNot applicable
Hi v-janeyg-msft ,
Thank you for your response. I applied the countx function to the measure as you've shown, but the result in my visual is that if any record is late, all dates show red.
When I filter the late record out with a slicer, they all go blue.
I am needing the colors to not be uniform, but indicate per date if there was a late record on that date. The result would be some dates as blue and some dates as red. Let me know if you have any further thoughts.
Thank you!
- v-janeyg-msft4 years agoCommunity Support
Hi, Anonymous
I am not clear what visual you are using and in which option the conditional formatting is used. Can you explain it?
It's fine with me.
Can you share a sample file? So we can see your problem intuitively.
Best Regards,
Community Support Team _ Janey