Forum Discussion
motzplo
7 years agoRegular Visitor
Timediff between rows depending on index
Hello all, I have the following problem and I hope some of you can help me. I would like to calculate the time difference between two rows, depending on the ID. Time difference between two rows o...
- 7 years ago
Hi motzplo,
Try this formula, please.
Column = VAR currentID = [ID] VAR currentIndex = [Index] VAR nextDatetime = CALCULATE ( MIN ( Table1[Datetime] ), FILTER ( 'Table1', 'Table1'[ID] = currentID && 'Table1'[Index] = currentIndex + 1 ) ) RETURN DATEDIFF ( [Datetime], nextDatetime, MINUTE )Best Regards,
Dale
Ashish_Mathur
7 years agoSuper User
Hi,
Try this calculated column formula
=CALCULATE(MIN(Data[Datetime]),FILTER(Data,Data[ID]=EARLIER(Data[ID])&&Data[Datetime]>EARLIER(Data[Datetime])))-[Datetime]
Hope this helps.