Forum Discussion

DiepNhiep's avatar
DiepNhiep
Frequent Visitor
2 years ago
Solved

PeriodOverPeriod with Date slicer

Hi, I would like to get help with the Measure of custom period and date slicer. I want to show the table with this information, for example   Date slicer in report to be set: May 3rd 2023 to May 25...
  • Uzi2019's avatar
    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)