I am trying to show the current months sales in a table that also looks at Median, average. The figure returned for each month is correct. However the total is not correct.
SalesMostRecentdaMonth = CALCULATE(Sum('Sales'[Sales]),DATESINPERIOD(Dates[Date],MAX(Dates[Date]),-1,MONTH))