Forum Discussion

M-M-P's avatar
M-M-P
Helper III
6 years ago
Solved

Subtract the current value from the previous value?

Hello everyone   I've been struggling with a calculated column. I have a table that looks like this:   I'm trying to subtract the current value from the previous value so I get a new colum...
  • Ashish_Mathur's avatar
    Ashish_Mathur
    6 years ago

    Hi,

    Does this work?

    Data[Value]-LOOKUPVALUE(Data[Value],Data[Timestamp],CALCULATE(MIN(Data[Timestamp]),FILTER(Data,Data[Timestamp]>EARLIER(Data[Timestamp])&&Data[UnitID]=EARLIER(Data[UnitID]))),Data[UnitID],Data[UnitID])