Forum Discussion
Conditional formatting red, yellow and green
- 3 years ago
Hi Aya,
No worries!
So if I'm understanding correctly now (and knowing nothing else about your data model), I would do something like the following.
- Create three measures, one for each course, since they have different timelines. (Example for Business Continuity below. You will need to update the RetakeDate variable when you create the measure for the other two columns.) This measure will tell the conditional formatting in the next step what colour to highlight the cell.
Business Continuity Conditional Formatting = -- Since it must be taken within a year, EDATE takes the date and calculates 12 months in the future VAR RetakeDate = EDATE ( MIN ( Table1[Business Continuity] ), 12 ) VAR Colour = SWITCH ( TRUE(), TODAY() - RetakeDate >= 365, "Red", TODAY() - RetakeDate >= 335, "Yellow", "Green" ) RETURN Colour- Right click the field in your table/matrix, going to Conditional Formatting, then Background Colour.
- Change Format Style to Field Value, then picking the corresponding field under "What field should we base this on?"
Here is a sample file I created in case it helps. This is what my report page looks like.
Please let me know if this is not what you were looking for or if your data model doesn't quite match and you're unable to modify the measure to your needs. 😄
----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?) - 3 years ago
Hi Wilson,
Thank you so much! The measures work. Thanks again
Hi Wilson,
Thank you so much! The measures work. Thanks again
Hey Aya,
Awesome, glad I could help. 😄
Could you please do me a favour and mark my last response as the solution to "close" this post and move that comment to the top in case other people with the same issue find this thread? I'd appreciate it.