Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Use previous rows for calculation

dear all,   I'm in need of a suggestion for how to calculate a column on base of the comparison of previous rows of other columns.   My data set is as follows, what I need to calculate is  - "(n...
  • Ashish_Mathur's avatar
    Ashish_Mathur
    2 years ago

    Hi,

    This calculated column formula works provided the entries in the "Comm. Cons" column are in ascending order.

    (net) Comm. Cons = [Comm. Cons]-CALCULATE(MAX(Data[Comm. Cons]),FILTER(Data,Data[Date]<EARLIER(Data[Date])))

    Hope this helps.