Forum Discussion
PeriodOverPeriod with Date slicer
- 2 years ago
Hi DiepNhiep
you can try with DATEADD() to calculted previous year record of same period.
Measure=
Var Previous sales = CALCULATE(SUM(Table[Sales]),DATEADD('Calendar'[Date],-1,YEAR))
Var Current sales= CALCULATE(SUM(Table[Sales]),DATEADD('Calendar'[Date],0,YEAR))
Return Divide((Current Sales-Previous sales),Previous Sales)
Hi DiepNhiep
you can try with DATEADD() to calculted previous year record of same period.
Measure=
Var Previous sales = CALCULATE(SUM(Table[Sales]),DATEADD('Calendar'[Date],-1,YEAR))
Var Current sales= CALCULATE(SUM(Table[Sales]),DATEADD('Calendar'[Date],0,YEAR))
Return Divide((Current Sales-Previous sales),Previous Sales)
Hi Uzi2019 ,
It is still not working if I do not choose the Date slicer that including last year...
For example above, if I choose Date slicer to be within May 2023, the Previous Sales as an independent measure would not appear. I want the Previous Sales as a measure also 😉 Thank youu
- Uzi20192 years ago
Community Champion
hi DiepNhiep
you can create seperate measure for Prev Sales.
and create seperate measure for %Change.
if it does not help then please share the screen shot of what value you are getting and what value you want.- DiepNhiep2 years agoFrequent Visitor
No problem at all, I just found out I had a small careless mistake. Your way is actually working, gonna mark it as the solution.
Have a nice day, thanks a lot again! 😉