Forum Discussion
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
- Sahir_Maharaj
Super User
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.
- StuartSmith
Power Participant
Thanks, you're suggestions worked 👊
- Sahir_Maharaj
Super User
Its my pleasure - Do not hesitate to reach out, if you might have further questions 🙂
- Sahir_Maharaj
Super User
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.
- Sahir_Maharaj
Super User
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.