I'm facing some difficulties in calculating the YoY Growth (sharing QTD sales vs the same period last year)
I'm using the formula below to calculate the QTD Orders from this year, and the result is coming right
QTD Sales = CALCULATE(COUNT('Orders'[Order Date]),DATESQTD(('Calendar'[ Date])))
The problem is in the formula that calculates the same period from last year:
Last Year QTD Orders = calculate(count(Orders'[Order Date]),DATESQTD(DATEADD('calendar'[ Date],-1,YEAR)))
It's bringing the result from the WHOLE quarter last year, not from the same period as this year (QTD)
I've tried to calculate using the SAMEPERIODLASTYEAR and I got the same results.
I don't know if the problem is in my calendar, which was built this way:
var mindate = year(MIN('Orders'[Order Date]))
var maxdate = YEAR(MAX('Orders'[Order Date]))
YEAR([Date]) >= mindate && YEAR([Date]) <= maxdate
"Quarter", FORMAT([Date], "\QQ"
I already marked the calendar as date table.
Thank you so much in advance