Forum Discussion
Dax for Dates RAG Status
- 3 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
Dangar332 This is amazing, thankyou so much. It is mainly working well except the dates before today are highlighting yellow instead of red? Any suggestions please?
hi, AMBP1973
check below it's correct compare today date . i mention today date(to) in image
if you still not get your answer provide some data
- AMBP19733 years ago
Helper III
Hi 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.
- Dangar3323 years ago
Resident Rockstar
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
- Dangar3323 years ago
Resident Rockstar
is this solution or still not get answer ?