Forum Discussion
AMBP1973
Helper III
2 years agoDax for Dates RAG Status
Hello Everyone, I am looking to add conditional formatting to a date column to highlight due dates using Red, Abber and Green. My date column is called 'Cancellation Date'. I would like to high...
- 2 years ago
hi, AMBP1973
try below codeoutput =var a = DATEDIFF(TODAY(),MAX('rag'[date]),MONTH)var b =SWITCH(TRUE(),a<=0,"#FF0000",a<=6&& a>0,"#FFBF00",a>6,"#00FF00")returnbHere you get only red and green combination becuase in your data which you provide none of date lies bw 0 to 6 month .i already calculate measurte which indicate difference bw today and due dateIf this post helps, then please consider Accepting it as the solution to help the other members find it more quickly. Appreciate your kudos
AMBP1973
Helper III
2 years agoHi Dangar332 , I have checked the DAX I input and it is exactly as you have stated. Here is a snapshot of the cancellation date colomun. Thankyou for your ongoing assistance.
Dangar332
Resident Rockstar
2 years agohi, AMBP1973
try below code
output =
var a = DATEDIFF(TODAY(),MAX('rag'[date]),MONTH)
var b =
SWITCH(TRUE(),
a<=0,"#FF0000",
a<=6&& a>0,"#FFBF00",
a>6,"#00FF00"
)
return
b
Here you get only red and green combination becuase in your data which you provide none of date lies bw 0 to 6 month .
i already calculate measurte which indicate difference bw today and due date
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly. Appreciate your kudos