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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Not applicable

ERROR: Function "SAMEPERIODLASTYEAR" expects a contiguous selection....

I am hoping someone can shed light on what is causing this error.  


1.  I have a date table.   

2.  My date table is connected (one to many) to my shipments table

3.  I do not have any bidirectional relationships

4.  I am not using direct query


The issue is that if I use a measure such as this (or anything with DATEADD), I get this same error.   Such a basic measure but if I try to add my Month (from the date table) I get this error  (for example in table visual)


Total Revenue LY = CALCULATE([Total Revenue],SAMEPERIODLASTYEAR( 'Date Table'[Date]))




Community Champion
Community Champion

Have you marked your date table as Date Table ?


Mark As Date Table.png

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

Proud to be a Super User!

Super User
Super User

@Anonymous , Please make your relationship with the Date table Single directional. Because the error is for bidirectional relationships.

Can share relationship details. Double click on the relation and a box will open.

Not applicable

@amitchandak    As I mentioned in my post, I do not have any bidirectional relationships.  I have no idea why the error that comes up says I do.   




@Anonymous ,Can you please share a sample pbix after removing sensitive data.

Helpful resources

July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

Top Solution Authors