Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
DiepNhiep
Frequent Visitor

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 25th 2023

Table

Revenue (May.03.2023 to May.25.2023)

Previous Period Revenue (May.03.2022 to May.25.2022)

%Change between these two metrics


I have been using the common used SAMEPERIODLASTYEAR and it works perfectly if I chose the Date slicer has 2022. But if I only choose as the example above, it does not work. Could any one help me with this one please? Thank you so much!

1 ACCEPTED SOLUTION
Uzi2019
Super User
Super User

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)



 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

View solution in original post

4 REPLIES 4
Uzi2019
Super User
Super User

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)



 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

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

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.


 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

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! 😉

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.