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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Getting the wait time between times in different status and ids in the same column

Hey!!

How're  you doing?

 

I'm creating a BI to analise some stuff, but i'm having some issues manipulating time values.

 

The data was gettered from mongoDB in a connection with R and, with that all the data came in one, i mean, all de status and its updates came with it's respective time, so i can't calculate between columns for, as all the datatimes lies on the same column, and the power bi won't let me use simple "Datediff" ou calculate just with the column, when it asks for a previews operation like max('status'[datetime]), what i think would just give me the last data.

 

My objective is to adquire the time beetween a change of status for each id on the table, or at least it's maximum and it's mean values.

 

Here's a exemple of what i'm talking about:

 

IdStatusDatetime
5ff34563ebaa650023799723ENTER_QUEUE04-01-2021 16:42:11
5ff34566ebaa650023799725IN_ATTEND04-01-2021 16:42:14
5ff3457bebaa65002379972aFINISH_ATTEND04-01-2021 16:42:36
5ff3456eebaa650023799727ENTER_QUEUE04-01-2021 16:42:23

 

I've tried to do many thing with that but it's getting weird to do, like i did a table for each status and then merged it's times to compare, and it's the closest I got to what I need. 

 

Sorry if it's too basic or not a proper topic to discuss, but i'm kind of new on power bi.

 

 

 

1 REPLY 1
Greg_Deckler
Community Champion
Community Champion

@Anonymous See my article on Mean Time Between Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/339586.
The basic pattern is:
Column = 
  VAR __Current = [Value]
  VAR __PreviousDate = MAXX(FILTER('Table','Table'[Date] < EARLIER('Table'[Date])),[Date])

  VAR __Previous = MAXX(FILTER('Table',[Date]=__PreviousDate),[Value])
RETURN
  __Current - __Previous



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
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Users online (27)