Forum Discussion

StuartSmith's avatar
StuartSmith
Icon for Power Participant rankPower Participant
3 years ago
Solved

Datediff between latest date and todays date

I have a table visual with a date column and its configured to show the "Latest".  I now need a column to show the datediff between the latest date and today.  I can figure out the DateDiff bit, but not to check the latest date. 

Thanks in advance.

  • Days Since Latest = DATEDIFF([Latest Date], TODAY(), DAY)

     

    Replace [Latest Date] with the name of the measure you created to find the latest date.

     

    This formula calculates the difference between the latest date and today in days. You can change the last argument in the DATEDIFF function to calculate the difference in a different unit of time, such as weeks or months as per your needs.

     

    Let me know if this works for your scenerio and if you may need further assistance.

5 Replies

  • Days Since Latest = DATEDIFF([Latest Date], TODAY(), DAY)

     

    Replace [Latest Date] with the name of the measure you created to find the latest date.

     

    This formula calculates the difference between the latest date and today in days. You can change the last argument in the DATEDIFF function to calculate the difference in a different unit of time, such as weeks or months as per your needs.

     

    Let me know if this works for your scenerio and if you may need further assistance.

      • Sahir_Maharaj's avatar
        Sahir_Maharaj
        Icon for Super User rankSuper User

        Its my pleasure - Do not hesitate to reach out, if you might have further questions 🙂

  • Hello StuartSmith,

     

    To calculate the datediff between the latest date and today in your table visual, you'll first need to determine what the latest date is. You can do this by using a measure that calculates the maximum date in the column.

  • Latest Date = MAX('Table'[Date])

    Replace 'Table'[Date] with the name of your date column.

     

    Once you have the latest date, you can calculate the datediff between that date and today using the DATEDIFF function.