Obviously I can't really help with the missing pay out date - you'll need to dig through your data and see if you can find if it's possible to link this up to a transaction or derive it in some other way. (for the time being I just excluded Dunn = "X" as they are not on going rentals)
So there was one basic issue in the calc in that I had inverted the greater than and less than conditions on the date filters. But the other thing I could see was that in the running calculation we don't actually want to exclude Dunn="R" otherwise we mask out all the return dates and we will not see any of those dips in the data like on Jan-6 where we have a return but no new rentals on that date.
So the following code gives me the same graph as the one you plotted in Excel
Current Rentals =
VAR _maxDate =
MAX ( 'Calendar'[Date] )
RETURN
CALCULATE (
COUNTROWS ( 'scrental' ),
FILTER (
ALL ( 'scrental'[Contract Date], 'scrental'[Return Date] ),
'scrental'[Contract Date] <= _maxDate
&& (
'scrental'[Return Date] = BLANK ()
|| 'scrental'[Return Date] > _maxDate
)
)
, 'scrental'[Dunn] <> "X"
)The other thing I noticed was that the "P" records are payments. I assume being rentals that you would get multiple payments per instrument, so you may want to look at changing the COUNTROWS( 'scrental' ) to count distinct instrument, customer or contract id's with something like DISTINCTCOUNT( 'scrental'[contract id] ).