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

Difference in time between records in the same column

Hi all,

 

I had a question about a formula I wanted to create. I created a calculated column that shows the average time a object was at a certain point (TimeAtPoint) what I want to know is the time between two of those records. For example:

 

Capture.PNG

Through slicing I want to know what the time is between for example A and B which would give 00:10:00 in this example. Between A and C it would give 00:30:00 (this variable would be called TravelTime)

(TimeAtPoint is in H:mm:ss)

 

the next step is to calculate the distance between those 2 points, which could be achieved by TravelTime * speed. Although I have no idea how to achieve this yet.

 

Thanks in Advance !

2 ACCEPTED SOLUTIONS
Greg_Deckler
Community Champion
Community Champion

Perhaps use a measure that calculates the difference between the MIN and MAX of the column?



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

v-caliao-msft
Microsoft Employee
Microsoft Employee

@Anonymous,

 

Through slicing I want to know what the time is between for example A and B which would give 00:10:00 in this example.

So you will select two items in your slicer? If that is the case, you can use the measure below.
Difference = MAX(Table1[TimePoint])-MIN(Table1[TimePoint])

Capture.PNGCaptur1e.PNG

Regards,

Charlie Liao

View solution in original post

3 REPLIES 3
v-caliao-msft
Microsoft Employee
Microsoft Employee

@Anonymous,

 

Through slicing I want to know what the time is between for example A and B which would give 00:10:00 in this example.

So you will select two items in your slicer? If that is the case, you can use the measure below.
Difference = MAX(Table1[TimePoint])-MIN(Table1[TimePoint])

Capture.PNGCaptur1e.PNG

Regards,

Charlie Liao

Anonymous
Not applicable

Hi all,

 

First of all thanks for taking time to help me.

 

And yes this worked the same for me as in the example @v-caliao-msft recreated. The next step in my formula would be to calculate a distance by "TimeDifference" * "speed". Although I am not sure how to approach this problem since I don't know how to make the multiply understand that I want "TimeDifference" multiplied by the speed the object had between point A and B or A and C for example. I was wondering if any of you had an idea on how to approach this problem.

 

Regards,

 

L. Meijdam

Greg_Deckler
Community Champion
Community Champion

Perhaps use a measure that calculates the difference between the MIN and MAX of the column?



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 Global Hackathon Carousel

FabCon Global Hackathon

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

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.