Power BI refer to previous row

Background

sample data

Formula is like:

In PowerBI we cannot refer to self (e.g. previous row same column), but can refer to previous row another column.

So we can make kind of math transformation:

The transformed formula:

Step

  • Load Data

  • Add Index Column

  • Add Custom Column 'result', make formula:

the List.Last can be replace by List.Max, and List.First can be replaced by Lits.Min regard of context.

  • Final Result:

References

Last updated

Was this helpful?