I have an matrix that informs the following information:
Current sales: Is the sum of the sales in the passed days in the current month till yesterday.
Last year sales: It's pretty much the same thing of current sales but in the last year.
E.g.: Today is day 9. So I need sales from day 1 to day 8 of this year and the previous year.
Previous year total sales: Total sales for the same month in the previous year E.g.:
It's May/17. Then the matrix shows the sales of whole May/16.
I have 2 report level filters: Month and year.
I tried to make last year sales with dax formulas but I did not succeed. Is there a dax formula that does this?
I have two tables: the classic calendar and the other is salestable.
calendar 1 - * salestable
Something like this should work:
Current Sales := SUM(SalesTable[Sales])
Current Sales MTD := CALCULATE([Current Sales], DATESMTD(Calendar[Date]))
Current Sales MTD - PY := CALCULATE([Current Sales], DATEADD(DATESMTD(Calendar[Date]), -1, YEAR)))
unfortunately current Sales MTD Is reporting the full-month sale of May not only the MTD. This information is also good but I also need to know the MTD of May last year.
Would it be acceptable to adjust your calendar table to STOP on the last day you have sales? Then, I think you would get what you want?
I have found a similar thread, please refer to the solution to check whether it applies to your scenario.
Compare MTD with previous period
We're rolling out new Kudos Given badges. Find out how many Kudos you've given.
Find out where you can attend!