Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 of a different ID is not possible. The time difference should look like the following picture.
Thank you in advance.
Solved! Go to Solution.
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
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.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |