Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Dates breakdown for Countdown

Hi All

 

Hope you could help

 

I've been tasked with the breakdown of dates "Review" table to have a breakdown that will show "3 months left until review", "2 months left untl review", "1 month left until review" and "Review Required"

 

I have used the following approach 

Column =
IF ( DATEDIFF ( TODAY (), 'Location Expiration Index'[Review], MONTH ) = 3, "3 Month", "NO ALERT",
IF (DATEIFF(TODAY(), 'Location Expiration Index'[Review],MONTH)=2, "2 Month", "NO ALERT"
 
Was hoping to get down to "1 Month" and "No Alert" and then Today()=Month(), but starting from the second line DAX doens't seem to accept it
 
Any suggestions on my code, or alternatives will be greatly welcomed 
 
PS I have tried else IF as well, to no avial 
Column =
IF ( DATEDIFF ( TODAY (), 'Location Expiration Index'[Review], MONTH ) = 3,THEN "3 Month",
ELSE IF
( DATEIFF (TODAY (), 'Location Expiration Index'[Review],MONTH) = 2, "2 Month",))
  • Hello ,

     

    try this :

     

    Column =
    IF ( DATEDIFF ( TODAY (), 'Location Expiration Index'[Review], MONTH ) = 3, "3 Month",
    IF (DATEIFF(TODAY(), 'Location Expiration Index'[Review],MONTH)=2, "2 Month", "NO ALERT"

     

    If I answered your question, please mark my post as solution, Appreciate your Kudos!

  • hello,

     

    Yes try it like this, there was an error in the typing of the measure :

     

    Column =
    IF ( DATEDIFF ( TODAY (), 'Location Expiration Index'[Review], MONTH ) = 3, "3 Month",
    IF (DATEDIFF(TODAY(), 'Location Expiration Index'[Review],MONTH)=2, "2 Month",

    IF (DATEDIFF(TODAY(), 'Location Expiration Index'[Review],MONTH)=1, "1 Month", "NO ALERT"

5 Replies

  • hello,

     

    Yes try it like this, there was an error in the typing of the measure :

     

    Column =
    IF ( DATEDIFF ( TODAY (), 'Location Expiration Index'[Review], MONTH ) = 3, "3 Month",
    IF (DATEDIFF(TODAY(), 'Location Expiration Index'[Review],MONTH)=2, "2 Month",

    IF (DATEDIFF(TODAY(), 'Location Expiration Index'[Review],MONTH)=1, "1 Month", "NO ALERT"

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you so much man!

       

      Could you please point out what the error was previously for me to learn from it?

       

      One last variable to be added for it to be complete

       

      Could I kindly ask for your help one more time?

       



      • Anonymous's avatar
        Anonymous
        Not applicable

        Actually, that's how I've done it in the end

         

        Column =
        IF ( DATEDIFF ( TODAY (), 'Location Expiration Index'[Review], MONTH ) = 3, "3 Month",
        IF (DATEDIFF(TODAY(), 'Location Expiration Index'[Review],MONTH)=2, "2 Month",
        IF (DATEDIFF(TODAY(), 'Location Expiration Index'[Review],MONTH)=1, "1 Month",
        IF (DATEDIFF(TODAY(),'Location Expiration Index'[Review],MONTH)=TODAY(), "ALERT", "NO ALERT"))))
        Thank you so much once again, will accept your answer as solution, as wouldn't get there without your help ❤️
  • Hello ,

     

    try this :

     

    Column =
    IF ( DATEDIFF ( TODAY (), 'Location Expiration Index'[Review], MONTH ) = 3, "3 Month",
    IF (DATEIFF(TODAY(), 'Location Expiration Index'[Review],MONTH)=2, "2 Month", "NO ALERT"

     

    If I answered your question, please mark my post as solution, Appreciate your Kudos!

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi 

      Thank you for getting back to me

       

      I've tried following your advise, and got the below:

       

      Any further help will be greatly appriciated