Forum Discussion
mateusz_ta
11 months agoFrequent Visitor
Conditional formatting not working
I have a matrix visual with dates as values. If the date is not older than 6 months then the value should be green. However, for example, the first field of the matrix says 2025-08, hence, the backgr...
- 11 months ago
Hi mateusz_ta ,
Please follow the below approach,
write a measure like below,
BG color = IF(MAX(FACT_Orders[Order Date])<=TODAY() && MAX(FACT_Orders[Order Date])>=EDATE(TODAY(),-6),"Green","Red")use this measure in the Background color formula,then the result will be as you expected as below
Thanks.
pankajnamekar25
11 months agoSuper User
Hello mateusz_ta
Try with below DAX for CF
BG Color =
VAR CurrentDate = MAX( FACT_Orders[Order Date] )
RETURN
IF (
CurrentDate >= EDATE ( TODAY(), -6 )
&& CurrentDate <= TODAY(),
"Green",
"Red"
)
If my response helped you, please consider clicking
Accept as Solution ✅ and giving it a Like 👍 – it helps others in the community too.
Thanks,
Connect with me on: