Forum Discussion
tameemyousaf
5 years agoHelper I
Difference Between Two Dates in Single Column
Hi, I have data that has timestamp in sigle row. I want to calculate the difference (in seconds or minuites) between two timestamps and need to show in another column or measure. Can anyone please h...
- Anonymous5 years ago
Hi tameemyousaf ,
Check the formula.
Column = var lasttime = CALCULATE(MAX('Table'[timestamp]),FILTER('Table','Table'[timestamp]<EARLIER('Table'[timestamp]))) return IF(ISBLANK(lasttime),BLANK(),DATEDIFF(lasttime,'Table'[timestamp],MINUTE))Best Regards,
Jay
tameemyousaf
5 years agoHelper I
Fowmy Thanks for your reply. I have only one timestamp column. In this case what will be the value of _dateTime variable.
ryan_mayu
5 years agoSuper User
you can try this
Column =
VAR last=MAXX(FILTER('Table','Table'[Timestamp]<EARLIER('Table'[Timestamp])),'Table'[Timestamp])
return if(ISBLANK(last),0,round(('Table'[Timestamp]-last)*3600*24,0))
pls see the attachment below