Forum Discussion
Difference between several dates in the same column
- Anonymous2 years ago
Hi jobf
Thanks for the reply from samratpbi .
jobf , you can try the following measure:
Difference = VAR _Previous = MAX('Table'[Date]) VAR _PreviousRowDate = CALCULATE( MAX('Table'[Date]), FILTER( ALLEXCEPT('Table', 'Table'[Field]), 'Table'[Date] < _Previous ) ) RETURN IF( ISBLANK(_PreviousRowDate), 0, MAX([Date]) - _PreviousRowDate )Output:
Best Regards,
Yulia XuIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, there are many ways, however I think the easiest way is to use newly introduced visual level calculation.
Its under Home -> New Calculation.
I have loaded your data and created the below calculation as New Calculation:
If this helps to resolve your problem, then please mark it as solution provided. Thanks
Dont forget to give kudos 🙂
- jobf2 years agoHelper II
Is there a way to do this without the PREVIOUS function?
- Anonymous2 years agoNot applicable
Hi jobf
Thanks for the reply from samratpbi .
jobf , you can try the following measure:
Difference = VAR _Previous = MAX('Table'[Date]) VAR _PreviousRowDate = CALCULATE( MAX('Table'[Date]), FILTER( ALLEXCEPT('Table', 'Table'[Field]), 'Table'[Date] < _Previous ) ) RETURN IF( ISBLANK(_PreviousRowDate), 0, MAX([Date]) - _PreviousRowDate )Output:
Best Regards,
Yulia XuIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.