Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Tan_LC
Helper II
Helper II

Aging Days calculation by Date Time

Hi,

 

I would like to count the day(s) variance as refer to the date time column using DAX.

In addition, the date time in "Now" column shall be dynamic as it shall reflect current date time at any point of time.

Kindly assist.

 

DatetimeNowAging Day(s)
29/07/2024 09:29:37 AM30/07/2024 10:33:24 AM1
29/07/2024 10:47:48 AM30/07/2024 10:33:24 AM0
28/07/2024 09:56:05 PM30/07/2024 10:33:24 AM1
28/07/2024 03:49:18 AM30/07/2024 10:33:24 AM2

 

Thank you.

 

Regards,

Tan LC

1 ACCEPTED SOLUTION

@Tan_LC , if you want it as per 24 hour than create a new calulated column

 

Aging Days = INT((NOW() - [Datetime]) * 24)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

3 REPLIES 3
bhanu_gautam
Super User
Super User

@Tan_LC , You can create a new calculated column for this using datediff

 

Aging Days = DATEDIFF([Datetime], NOW(), DAY)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Hi @bhanu_gautam , thanks for your quick response.

The result turned to be not so accurate, for example:

 

Datetime: 30/07/2024 7:02:57 PM

Current Datetime: 31/07/2024 2:26:14 PM

Aging Days should be 0 days instead of 1 day as it yet to reach 24 hours.

 

Thank you.

 

Regards,

LC

@Tan_LC , if you want it as per 24 hour than create a new calulated column

 

Aging Days = INT((NOW() - [Datetime]) * 24)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.