Forum Discussion
miguelsus2000
Helper III
4 years agoDate difference between dates in different rows
Hi, I've seen some examples out in the internet, but cannot seem to solve it yet. I have the following table Timestamp User Location 1 1/22/2022 3:41:00 Use...
- 4 years ago
miguelsus2000 , A new column like this can help
new column =
var _min = maxx(filter(Table, [user] =earlier([user]) && [Location] = earlier([Location]) && [Timestamp] < earlier([Timestamp])), [Timestamp])
return
datediff(_min, [Timestamp], second)
v-henryk-mstf
Community Support
4 years agoHi miguelsus2000 ,
Try the formula like below:
col2 =
VAR rank_ =
RANKX (
FILTER ( ALL ( Test ), Test[Location] = EARLIER ( Test[Location] ) ),
Test[ID]
)
VAR _min =
CALCULATE (
MAX ( Test[Timestamp] ),
ALLEXCEPT ( Test, Test[User], Test[Location] ),
Test[Timestamp] < EARLIER ( Test[Timestamp] )
)
RETURN
IF ( rank_=1, blank(), DATEDIFF ( _min, [Timestamp], minute))
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- miguelsus20004 years ago
Helper III
Thank you... i tried another one that seemed to work for me. Thank you.