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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
prathmesh_patel
Frequent Visitor

Calculate running elapsed time for each record usingDAX Measure. Also Aggregate the same.

Hello,

Need some help with DAX measure to calculate running elapsed time in hours for each records since its created timestamp. 

The ask is two fold. 

* First one is when this measure is added to a table, it should show elapsed time in hours for each row as of Now.

* Second one is when this measure is added to a card visual, it should show average elapsed time in hours for all applicable rows as filtered.

Data Table:

prathmesh_patel_0-1619863661066.png

The Elapsed Time calculation should be in hours "createdon - Now()" and should keep updating when the visual is updated using the current date/time (Now()).

If this same Measure is used in, lets say "Card Visual", it should show Average of elapsed time for all the records.

 

Appreciate any help on this.
1 ACCEPTED SOLUTION
daxer-almighty
Solution Sage
Solution Sage

[Avg Elapsed Time until Now] =
AVERAGEX(
    T,
    var Created_ = T[Created On]
    var Now_ = NOW()
    var SecondsPerHour = 60 * 60
    RETURN
        DATEDIFF(SECOND, Created_, Now_) / SecondsPerHour
)

Something like this? If you want even greater precision, you could try to calculate using milliseconds... but I doubt you'd want to even go down to the seconds. Minutes would probably do as well.

View solution in original post

2 REPLIES 2
daxer-almighty
Solution Sage
Solution Sage

[Avg Elapsed Time until Now] =
AVERAGEX(
    T,
    var Created_ = T[Created On]
    var Now_ = NOW()
    var SecondsPerHour = 60 * 60
    RETURN
        DATEDIFF(SECOND, Created_, Now_) / SecondsPerHour
)

Something like this? If you want even greater precision, you could try to calculate using milliseconds... but I doubt you'd want to even go down to the seconds. Minutes would probably do as well.

This works great for both of my scenarios. Thank you so much!

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.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.