Forum Discussion
Conditional formatting not working
- 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.
Your matrix shows the correct date (2025-08), but the background color is wrong because “Last” in conditional formatting doesn’t mean latest date—it just grabs the last row in the current filter context, which might be older (e.g., 2021-08 with Red).
✅ Fix:
Use a DAX measure to get the StatusColor for the latest price_date_max, or sort your table by price_date_max descending so “Last” pulls the right row.
Let me know if you want the exact DAX snippet.
LatestStatusColor =
VAR LatestDate =
CALCULATE(
MAX('YourTable'[price_date_max]),
ALLEXCEPT('YourTable', 'YourTable'[Make], 'YourTable'[Country])
)
RETURN
CALCULATE(
MAX('YourTable'[StatusColor]),
'YourTable'[price_date_max] = LatestDate
)