Forum Discussion
Calculating Time Difference
- 5 years ago
Hi ljmanayon
I've checked the file, you can try this
Result I want Test = var _endtime=CALCULATE(MIN(test[Time]),FILTER(ALLEXCEPT('test',test[Branch],test[Date/Time],'test'[Service ID]),'test'[Remarks]="Done")) var _diff=DATEDIFF(MIN('test'[Time]),_endtime,MINUTE) return IF(MIN('test'[Remarks])="Serving",_diff&"mins")result
besides, in your previous example, the format of Time is xx:xx:00, while in your file, the format is xx:xx:xx, so I didn't add seconds into Measure.
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
amitchandak Thanks for answering. However, it returns thousands e.g. 5878, 6485, etc.
ljmanayon , Oh need one correction, My mistake
New column =
var _max = maxx(filter(Table, [Service ID] = earlier([Service ID]) && [Date Time] < earlier([Date Time]) && [Remarks] = " New Entry"),[Date Time])
return
if( [Remarks] = "Serving", datediff(_max,[Date Time], minute), blank())
- ljmanayon5 years agoFrequent Visitor
Thanks your help but I got 0 results or blank. And the formula takes so much time to calculate, unfortunately.