Forum Discussion
axk180022
4 years agoHelper II
Find difference between 2 rows
DateTime SerialId GenHours Difference 9/22/2020 18:04 M3501-118 4789 blank 4/12/2021 18:19 M3501-118 5047 258 5/5/2021 14:28 M3501-118 5047 0 6/17/2021 15:10 M...
AlexisOlson
4 years agoSuper User
Ah, I didn't realize you were looking for a DAX solution. That's actually a bit easier.
Try this:
Difference =
VAR CurrDateTime = SELECTEDVALUE ( Merge1[DateTime] )
VAR PrevDateTime = CALCULATE ( MAX ( Merge1[DateTime] ), Merge1[DateTime] < CurrDateTime )
VAR PriorGenHours = CALCULATE ( [Gen Hours], Merge1[DateTime] = PrevDateTime )
RETURN
IF ( NOT ISBLANK ( PriorGenHours ), ABS ( [Gen Hours] - PriorGenHours ) )axk180022
4 years agoHelper II
- AlexisOlson4 years agoSuper User
I can't tell what's going wrong since it works fine for me.
Check the attachment.