Forum Discussion
Birdie
7 years agoRegular Visitor
Calculate a value based on values in same column
Hi all, I hope this is a simple request. I have 3 columns of data: 1. Date/time - 10 second intervals 2. Value - integers increasing 3. Index - starts at zero and increases It looks like this:...
- 7 years ago
So, as a calculated column you could do this:
Column = VAR __index = [Index] VAR __index30 = [Index] - 3 RETURN IF(__index30 < 0,BLANK(), VAR __value = [Value] VAR __value30 = MAXX(FILTER(ALL(bottles),[Index] = __index30),[Value]) RETURN (__value - __value30) * 2 )
d_gosbell
7 years agoSuper User
One possible solution is to create a calculated column with an expression like the following:
BPM =
VAR _prevValue = LOOKUPVALUE('Table'[Value],'Table'[Index], 'Table'[Index] -3) RETURN IF(NOT(ISBLANK(_prevValue)), ( 'Table'[Value] - _prevValue) * 2)