Forum Discussion
Conditional Formatting on Dates - 2 months
Hi All.
Im currently attempting to apply conditional formatting to a date colum where the formatting is applied to turn the cell red when the date entered is 2 months or more before the current date. I'm unsure if I need to create a new column in order to do this, and if so what formula should I be using.
Any help would be much appreciated.
Regards,
Alaya
- Anonymous6 years ago
You can create a flag column using today()-60:
Flag = IF([Date]<=TODAY()-60,1,0)Then use the flag column as to rule the conditional formatting.
Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
2 Replies
- amitchandakSuper User
AlayaLove , Create a measure like
Color Date =
var _min = date(year(today()),month(today())-2,day(today())) // date(year(today()),month(today())-2,1)
var _max = date(year(today()),month(today())+2,day(today())) // date(year(today()),month(today())+2,1)
return
if(FIRSTNONBLANK('Date'[Date],blank) >= _min && FIRSTNONBLANK('Date'[Date],blank) <= _max ,"red","lightgreen")And use it with field option in color formatting
https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-numbers-in-the-column
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values - AnonymousNot applicable
You can create a flag column using today()-60:
Flag = IF([Date]<=TODAY()-60,1,0)Then use the flag column as to rule the conditional formatting.
Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly