Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Moving Range with time

I'm trying to get the time from one row to the next to determine how much time has elapsed from each entry.   I'm currently using this DAX statement:  Moving Range = VAR a = CALCULATE ( ...
  • v-qiuyu-msft's avatar
    6 years ago

    Hi Anonymous, 

     

    You can add an index column in Query Editor. Then create a calculated column like below: 

     

    Moving Range = var pre= CALCULATE(SUM('Table'[Time]),FILTER('Table','Table'[Same day Count]=EARLIER('Table'[Same day Count])&&'Table'[Index]=EARLIER('Table'[Index])-1))
    return IF(pre=BLANK(),BLANK(),DATEDIFF(pre,'Table'[Time],MINUTE))

     

     

    Best Regards,
    Qiuyun Yu