Forum Discussion
Difference between two values in same column
- 4 years ago
Hi Daxtothemax ,
According to your description, here's my solution.
Create a measure.
Diff2 = VAR _Diff = CALCULATE ( MAX ( 'DS'[Hrs] ), FILTER ( 'DS', 'DS'[Task] = EARLIER ( 'DS'[Task] ) && 'DS'[Date] = MINX ( ALL ( 'DS' ), 'DS'[Date] ) ) ) - 'DS'[Hrs] RETURN IF ( _Diff < 0, 0, _Diff )Get the expected result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Daxtothemax ,
According to your description, here's my solution.
Create a measure.
Diff2 =
VAR _Diff =
CALCULATE (
MAX ( 'DS'[Hrs] ),
FILTER (
'DS',
'DS'[Task] = EARLIER ( 'DS'[Task] )
&& 'DS'[Date] = MINX ( ALL ( 'DS' ), 'DS'[Date] )
)
) - 'DS'[Hrs]
RETURN
IF ( _Diff < 0, 0, _Diff )
Get the expected result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-yanjiang-msft thank you for this! It's getting closer. The only issue is that I need the difference between each date. So example below Task C should equal 8 comparing to the previous date. Any ideas on this?