There are three ways.
If the row with the Returning Date
will always be after the row with Leaving Date
, then you can use Previous()
:
=DaysBetween(Previous([Leaving Date]);[Returning Date])
But it would likely be better to use an In
context operator to grab the appropriate value:
=If Not(IsNull([Returning Date]) Then
DaysBetween (
Max([Leaving Date]) In ([Person ID];[Response ID]);
[Returning Date])
)
Lastly, if you don't actually need the Response ID
and Reason
displayed, you can remove them and wrap the two Date objects with =Max()
; that will cause them to aggregate to the same row. Then the comparison is easy:
=DaysBetween(Max([Leaving Date]);Max([Returning Date]))
All my examples are assuming that you're comparing the dates with DaysBetween, but of course any other comparison would be valid here.