Forum Discussion
Weekday current year vs last year
Hi Anonymous
I am a bit confused about your statement
"
because sometimes we have sales on sat/sunday..
so i used lastprocessed (date) = returned 1/20/2019 but for sunday of last year ( 1/21/2018) there were no sales ..thereby getting blanks "
The blank for previous year is what you expect ? Or you would like to go back further to say 1/20/2018 saturday if it had sales or 1/19/2018 Friday which would have had sales .
Kindly calrify.
Cheers
CheenuSing
So @CheenuSing
on monday 1/28/2019 , it should show daily sales of last friday (1/25/2019) , vs same friday lasy year (1/26/2018)
this is resolved
Total Sales CY Yesterday = CALCULATE([Total Sales], LASTDATE('Financial Data'[date_dt]))
Total Sales LY Yesterday = CALCULATE([Total Sales], DATEADD(LASTDATE('Financial Data'[date_dt]),-364,DAY))
but i ran into one more issue, if you could help me out
for MTD values
CY : it should calculate till 1/1/2019 to 1/27/2019 -- this is working
LY: it should calculate till 1/1/2018 to 1/28/2018 -- per calendar days; but 1/28/2018 is a weekend so the value is coming blank
Total Sales MTD CY = CALCULATE(TOTALMTD([Total Sales],'Financial Data'[date_dt])) -- this is correct
Total Sales MTD LY = TOTALMTD(SUM('Financial Data'[SaleAmount]), DATEADD(LASTDATE('Financial Data'[date_dt]),-364,DAY))