I am trying to compare sales for two separate years on ytd and mtd basis. But the first month in my data is jul and not jan; so for YTD current year it sould add jul-dec and similarly for the previous year. For MTD it should compare whatever is the latest month for the current year.
I have tried using datesinperiod with firstdate and also datesytd - but its not working :
My data looks like this :