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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
matdub40
Helper III
Helper III

The "SAMEPERIODLASTYEAR" function expects a contiguous selection

I have a measure "Evo%" that allows me to calculate the percentage change in sales between years, the formula is:

 

Evo %:=
DIVIDE (
[Euro Gross Amount]
- CALCULATE ( [Euro Gross Amount], SAMEPERIODLASTYEAR ( 'date'[date] ) ),
CALCULATE ( [Euro Gross Amount], SAMEPERIODLASTYEAR ( 'date'[date] ) ),
0
)


My date table has continuous values from 2018 to 2022 with no missing days:

matdub40_0-1630655012881.png

 

When I make my formula it worked perfectly and since yesterday I have as error on my Power BI report:


"Calculation error in measure 'dwh_d_order_sku'[Evo %]: The "SAMEPERIODLASTYEAR" function expects a contiguous selection when the date column comes from a table on side 1 of a bidirectional relationship."

 

I don't understand where this can come from since my dates are continuous. Can anyone help me with this?

1 ACCEPTED SOLUTION
goncalogeraldes
Super User
Super User

I think that the error is due to the nature of the relationship between your date table and dwh_d_order_sku table being set to bidirectional. Try switching it to single direction from the date table to the dwh_d_order_sku table, that is, from the one to the many side! 

 

 

goncalogeraldes_1-1630656774165.png

 

(please note that in this image the cardinality is many to many which is not your case, therefore just focus on the cross filter direction)

 

Hope this answer solves your problem! If you need any additional help please tag me in your reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️ or give it a kudoe 👍
Thanks!

Best regards,
Gonçalo Geraldes

View solution in original post

2 REPLIES 2
goncalogeraldes
Super User
Super User

I think that the error is due to the nature of the relationship between your date table and dwh_d_order_sku table being set to bidirectional. Try switching it to single direction from the date table to the dwh_d_order_sku table, that is, from the one to the many side! 

 

 

goncalogeraldes_1-1630656774165.png

 

(please note that in this image the cardinality is many to many which is not your case, therefore just focus on the cross filter direction)

 

Hope this answer solves your problem! If you need any additional help please tag me in your reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️ or give it a kudoe 👍
Thanks!

Best regards,
Gonçalo Geraldes

Hello @goncalogeraldes,

 

Thank you for your answer, indeed I had a one to one relationship and in both directions.
I changed to one to many from the date table to dwh_d_order_sku and it works!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Solution Authors