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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
rodrigomocca
Frequent Visitor

Average Time between rows

Hello,

I've looking through the forum and I can't find the answer, so I'm asking my particular case.

I have a simple table with 2 columns: Name, ReportedDate.

I need to make a measurement with the average time (in hours) between all the rows. For example:

Test 1 - 01/22/2018 10:00:00 AM

Test 2 - 01/22/2018 10:30:00 AM

Test 3 - 01/22/2018 11:00:00 AM

With this data, I have a half hour on average.

 

How can I do this?

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

See this article:

 

https://www.linkedin.com/pulse/mean-time-between-failure-mtbf-power-bi-greg-deckler-microsoft-mvp-/?...

 

You will want the column that uses the EARLIER function. At that point you can create another column that calculates the difference in hours or minutes and then you should be good to go.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

See this article:

 

https://www.linkedin.com/pulse/mean-time-between-failure-mtbf-power-bi-greg-deckler-microsoft-mvp-/?...

 

You will want the column that uses the EARLIER function. At that point you can create another column that calculates the difference in hours or minutes and then you should be good to go.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thanks for your help.

I'm trying to reproduce it in my case.

 

I'm having another error with this part: DATEDIFF([ResolvedDate],NOW(),SECOND)

ResolvedDate column has this data.

ResolvedDate

1/22/2018 6:07:13 PM
1/22/2018 6:11:13 PM
1/23/2018 4:11:30 PM
1/22/2018 6:12:01 PM
1/22/2018 6:11:44 PM

and the error message is this: In DATEDIFF function, the start date cannot be greater than the end date. How this is possible?

Yeah, DATEDIFF can be a pain:

 

DATEDIFF(NOW(),[ResolvedDate],SECOND)


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.