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
Blucas2018
Regular Visitor

SAMEPERIODLASTYEAR not working for old database

Hi,

I'm going through this tutorial but I'm having trouble using SAMEPERIODLASTYEAR on a table where the latest date is from 3 years ago.

 The tutorial recommned using:

 

  • Total Units: Total Units = SUM(Sales[Units])
  • LY Total Units: LY Total Units = CALCULATE([Total Units],SAMEPERIODLASTYEAR('Date'[Date]

but I get the same value for both measures. Could that be SAMEPERIODLASTYEAR is looking for 2017, therefore counting everything like SUM?

The data goes from year 2000 to 2015

Any suggestions

 

 

 

 

1 REPLY 1
Floriankx
Solution Sage
Solution Sage

Did you relate your date columns properly?

SAMEPERIODLASTYEAR doesn't know the actual year, and it doesn't how far your data goes back.

 

Is your date Table contigous and goes back far enough?

 

Best regards.

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.