Forum Discussion
Anonymous
6 years agoNot applicable
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 (
...
- 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
v-qiuyu-msft
6 years agoCommunity Support
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