Forum Discussion
Get next 3 row values for current row
- 6 years ago
Hi Anonymous ,
If you want a measure in table visual, parry2k’s solution is proper and great.
But if you want actual column in table, We can create following calculate columns to meet your requirement.
Next 1 = var x = CALCULATE(MIN('Table'[Sequence]),FILTER('Table','Table'[Sequence]>EARLIER('Table'[Sequence]))) return CALCULATE(MAX('Table'[Value]),FILTER('Table','Table'[Sequence]=x))Next 2 = var x = CALCULATE(MIN('Table'[Sequence]),FILTER('Table','Table'[Sequence]>EARLIER('Table'[Sequence]))) return CALCULATE(MAX('Table'[Next 1]),FILTER('Table','Table'[Sequence]=x))Next 3 = var x = CALCULATE(MIN('Table'[Sequence]),FILTER('Table','Table'[Sequence]>EARLIER('Table'[Sequence]))) return CALCULATE(MAX('Table'[Next 2]),FILTER('Table','Table'[Sequence]=x))And the result like this,
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
If you want a measure in table visual, parry2k’s solution is proper and great.
But if you want actual column in table, We can create following calculate columns to meet your requirement.
Next 1 =
var x = CALCULATE(MIN('Table'[Sequence]),FILTER('Table','Table'[Sequence]>EARLIER('Table'[Sequence])))
return
CALCULATE(MAX('Table'[Value]),FILTER('Table','Table'[Sequence]=x))
Next 2 =
var x = CALCULATE(MIN('Table'[Sequence]),FILTER('Table','Table'[Sequence]>EARLIER('Table'[Sequence])))
return
CALCULATE(MAX('Table'[Next 1]),FILTER('Table','Table'[Sequence]=x))
Next 3 =
var x = CALCULATE(MIN('Table'[Sequence]),FILTER('Table','Table'[Sequence]>EARLIER('Table'[Sequence])))
return
CALCULATE(MAX('Table'[Next 2]),FILTER('Table','Table'[Sequence]=x))
And the result like this,
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous6 years agoNot applicable
Thank you v-zhenbw-msft ! It's the solution, I was looking for.