did anyone tried to find a solution for this?
I cannot open your attached file so here is a general idea. For the previous month you will want DATEPART('month',[endDate]))-1. The YTD is a little more complicated but you should be able to find an example by searching "Working with Dates". If you plan to display both of these values on the same axis, you will need to look up "Two date ranges on the same axis". There are good examples available on all of these.
your date range is start date and end date.... now for previous month sales you need to go to previous month that means start date -30. or month number -1 so that you go to last month and display sales.
if month(date)>=month(end date) - 1 then
for january you need to write special logic...
this is for previous month sales.
if date>"1-1-" + year(date) and date<end date then
end... this is for ytd sales.... you may extend the logic little bit to get exact. of course you have many online readymade solutions for this query...