Forum Discussion
sirgseymour
7 years agoHelper I
Finding the difference between values on two dates the first being hte most current and the second
Hello, I have a dataset that has a value column with an associated Timestamp column. The timestamps are not uniform so the time between any two time stamps is different. What I am trying to do is...
- Anonymous7 years ago
Hi sirgseymour ,
You can try to use following measure to calculate diff between current and previous value:
Measure = VAR _currDate = MAX ( Table[TimeStamp] ) VAR _previous = CALCULATE ( MAX ( Table[TimeStamp] ), FILTER ( ALLSELECTED ( Table ), [TimeStamp] < _currDate ) ) RETURN MAX ( Table[Value] ) - LOOKUPVALUE ( Table[Value], Table[TimeStamp], _previous )Regards,
Xiaoxin Sheng
Anonymous
7 years agoNot applicable
Hi sirgseymour ,
You can try to use following measure to calculate diff between current and previous value:
Measure =
VAR _currDate =
MAX ( Table[TimeStamp] )
VAR _previous =
CALCULATE (
MAX ( Table[TimeStamp] ),
FILTER ( ALLSELECTED ( Table ), [TimeStamp] < _currDate )
)
RETURN
MAX ( Table[Value] ) - LOOKUPVALUE ( Table[Value], Table[TimeStamp], _previous )
Regards,
Xiaoxin Sheng