Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I have data of this format :
during import the data is sorted by date-time column then the Index column is added. So regardless how the table is sorted after import, the index can maintain a reference to sequential date-time values.
I am trying to add the duration-between calculated column which will calculate the difference between two rows based on the index order so in the picture above the first row would be blank or error, the second row would be 235 (minutes), the third would be 52 (minutes) and so on. These values would stay correctly calculated regardless of the ordering on the table.
Solved! Go to Solution.
This solution seems to work:
DurationBetween =
VAR CurrentDateTime = df[date-time]
VAR NextDateTime =
CALCULATE(
MIN(df[date-time]),
FILTER(
df,
df[date-time] > CurrentDateTime
)
)
RETURN
IF(
ISBLANK(NextDateTime),
BLANK(),
(NextDateTime - CurrentDateTime)*24*60
)
This solution seems to work:
DurationBetween =
VAR CurrentDateTime = df[date-time]
VAR NextDateTime =
CALCULATE(
MIN(df[date-time]),
FILTER(
df,
df[date-time] > CurrentDateTime
)
)
RETURN
IF(
ISBLANK(NextDateTime),
BLANK(),
(NextDateTime - CurrentDateTime)*24*60
)