Hello all, on a chart, can i compare to the same day last year. e.g compare Monday to the previous years closest Monday. At the momene my chart looks like this.
As you can see the comparison is out of sync.
Here is the dax i use
Mail Received Previous Year = calculate([Total MailReceived],SAMEPERIODLASTYEAR('DIM - Date Table'[Date]))
Solved! Go to Solution.
@NewbieJono , Please try a suggestion from @ashwinwullems , same week day last year is 364 days behind. So should work for leap year too
example
week Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-364,DAY))
Yes Monday is peak day, just wanted to match them up. Does anyone know what the dax for this would be
you can try dateadd ( <Dates>, -52*7, DAYS)
what does this do, would it deal with a leap year?
@NewbieJono , Please try a suggestion from @ashwinwullems , same week day last year is 364 days behind. So should work for leap year too
example
week Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-364,DAY))
Sameperiodlastyear is the exact date from last year. If this is sales related there might be a discrepancy in dates vs sales dates (weekdays vs weekends).
You can try using some form of dateadd to get the dates closer to eachother.
DATEADD ( <Dates>, -365, DAY )
User | Count |
---|---|
129 | |
61 | |
57 | |
55 | |
43 |
User | Count |
---|---|
121 | |
60 | |
59 | |
54 | |
49 |