YTD Showing for Months after Last Sale

Ok try these formulas to get what you need.

Sales YTD = 
VAR LastSalesDate = MAXX( ALL( Sales[Purchase Date] ), Sales[Purchase Date] )
VAR YTDSales = TOTALYTD( [Total Sales], Dates[Date] )

RETURN
IF( MIN( Dates[Date] ) <= LastSalesDate, YTDSales, BLANK() )



Sales YTD LY demo = 
VAR LastSalesDate = MAXX( ALL( Sales[Purchase Date] ), Sales[Purchase Date] )

RETURN
CALCULATE( [Sales YTD],
    SAMEPERIODLASTYEAR(
        INTERSECT( VALUES( Dates[Date] ), DATESBETWEEN( Dates[Date], BLANK(), LastSalesDate ) ) ) )

This technique should solve it.

(It should be easier that this I know, but for some reason they make the totals a little hard to work out sometimes)