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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
saipawar
Helper IV
Helper IV

calculate number of days past specific date

Hi, 

 

I would like to show a timer that shows 'number of days' past the event. 

So if the event occurred Oct 5,

on Oct 6 - the timer should show 1. 

 

Enhancement (if possible)- 

If I can show past  day, hour, minutes

4 ACCEPTED SOLUTIONS
lbendlin
Super User
Super User

=TODAY() - [Event Date]

=NOW() - [Event Date/Time]

 

use FORMAT to show the desired output.

View solution in original post

SachinNandanwar
Super User
Super User

Not completely sure what is the ask. Is this something that you are looking for ? I have expressed the ourtput in terms for hours.

SachinNandanwar_0-1729291689630.png

 

 

No of Hours since last event = 
VAR _Dt =
    MAX ( Events[Date] )
VAR _tbl =
    FILTER ( ALL ( Events ), Events[Date] < _Dt && Events[Event Occurred] =1 )
VAR _Dt1 =
    MAXX ( _tbl, Events[Date] )
RETURN
    DATEDIFF ( _Dt1, _Dt, HOUR )

 

 



Regards,
Sachin
Check out my Blog

View solution in original post

Bibiano_Geraldo
Super User
Super User

hi, You can use the following code to achieve your goal, dont forget to replace the column names with your owns

Time Past = 
VAR __Now = NOW()
VAR __EventDate = [EventDate]
RETURN 
FORMAT(__Now - __EventDate, "d \d\a\y\s\ h\ \h\o\u\r\s\ m\ \m\i\n\u\t\e\s")

 

View solution in original post

Kedar_Pande
Super User
Super User

@saipawar 

Create a Date Table

DateTable =
CALENDAR ( MIN ( 'YourTable'[EventDate] ), TODAY () )

Create a Measure for Days Passed

DaysPassed =
VAR EventDate =
DATE ( 2024, 10, 5 ) // Replace with your event date
RETURN
DATEDIFF ( EventDate, TODAY (), DAY )

Add a card visualization to your report and set its value to the DaysPassed measure. This will show the number of days since October 5.


Create a Detailed Timer Measure

DetailedTimer =
VAR EventDate =
DATE ( 2024, 10, 5 ) // Replace with your event date
VAR CurrentDateTime =
NOW ()
VAR TotalMinutes =
DATEDIFF ( EventDate, CurrentDateTime, MINUTE )
VAR Days =
INT ( TotalMinutes / 1440 ) // Total minutes in a day
VAR Hours =
INT ( MOD ( TotalMinutes, 1440 ) / 60 ) // Remaining hours
VAR Minutes =
MOD ( TotalMinutes, 60 ) // Remaining minutes
RETURN
FORMAT ( Days, "0" ) & " days "
& FORMAT ( Hours, "0" ) & " hours "
& FORMAT ( Minutes, "0" ) & " minutes"

💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

 

View solution in original post

6 REPLIES 6
Kedar_Pande
Super User
Super User

@saipawar 

Create a Date Table

DateTable =
CALENDAR ( MIN ( 'YourTable'[EventDate] ), TODAY () )

Create a Measure for Days Passed

DaysPassed =
VAR EventDate =
DATE ( 2024, 10, 5 ) // Replace with your event date
RETURN
DATEDIFF ( EventDate, TODAY (), DAY )

Add a card visualization to your report and set its value to the DaysPassed measure. This will show the number of days since October 5.


Create a Detailed Timer Measure

DetailedTimer =
VAR EventDate =
DATE ( 2024, 10, 5 ) // Replace with your event date
VAR CurrentDateTime =
NOW ()
VAR TotalMinutes =
DATEDIFF ( EventDate, CurrentDateTime, MINUTE )
VAR Days =
INT ( TotalMinutes / 1440 ) // Total minutes in a day
VAR Hours =
INT ( MOD ( TotalMinutes, 1440 ) / 60 ) // Remaining hours
VAR Minutes =
MOD ( TotalMinutes, 60 ) // Remaining minutes
RETURN
FORMAT ( Days, "0" ) & " days "
& FORMAT ( Hours, "0" ) & " hours "
& FORMAT ( Minutes, "0" ) & " minutes"

💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

 

Bibiano_Geraldo
Super User
Super User

hi, You can use the following code to achieve your goal, dont forget to replace the column names with your owns

Time Past = 
VAR __Now = NOW()
VAR __EventDate = [EventDate]
RETURN 
FORMAT(__Now - __EventDate, "d \d\a\y\s\ h\ \h\o\u\r\s\ m\ \m\i\n\u\t\e\s")

 

SachinNandanwar
Super User
Super User

Not completely sure what is the ask. Is this something that you are looking for ? I have expressed the ourtput in terms for hours.

SachinNandanwar_0-1729291689630.png

 

 

No of Hours since last event = 
VAR _Dt =
    MAX ( Events[Date] )
VAR _tbl =
    FILTER ( ALL ( Events ), Events[Date] < _Dt && Events[Event Occurred] =1 )
VAR _Dt1 =
    MAXX ( _tbl, Events[Date] )
RETURN
    DATEDIFF ( _Dt1, _Dt, HOUR )

 

 



Regards,
Sachin
Check out my Blog
lbendlin
Super User
Super User

=TODAY() - [Event Date]

=NOW() - [Event Date/Time]

 

use FORMAT to show the desired output.

How do I pass the event date to the measure

 

Past Days = NOW()-10.21.2025

Past Days = TODAY() - dt"2024-10-21"   

 

(i hope you meant 2024, not 2025)

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors