I use these two measures quite a bit. YTD Total Sales is straight forward and calculates in this case a sum of sales from the 1st of July to today. The trick is what to do when you want to compare the same period for the previous year. That is where a handy function called SAMEPERIODLASTYEAR comes very handy. Check out the functions below and give it a try.
Note: ‘Calendar’ is a Calendar Table, ‘Query1’ is a fact table