March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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
Solved! Go to Solution.
=TODAY() - [Event Date]
=NOW() - [Event Date/Time]
use FORMAT to show the desired output.
Not completely sure what is the ask. Is this something that you are looking for ? I have expressed the ourtput in terms for hours.
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 )
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")
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
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
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")
Not completely sure what is the ask. Is this something that you are looking for ? I have expressed the ourtput in terms for hours.
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 )
=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 = TODAY() - dt"2024-10-21"
(i hope you meant 2024, not 2025)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
89 | |
84 | |
70 | |
51 |
User | Count |
---|---|
206 | |
143 | |
97 | |
79 | |
68 |