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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
yaman123
Post Partisan
Post Partisan

SAMEPERIODLASTYEAR error

Hi, 

 

I have a simple dax formula to calculate the sum for the same period last year - 

 

Measure =
CALCULATE(
    SUM(
        Query1[RECEIVED_TOTAL_LINE]),
        SAMEPERIODLASTYEAR(Query1[REAL_DELIVERY_DATE]))
 
I only have one table (Query1) as it is a simple report and do not have a date table. I have a sbetween slicer on real delivery date. I am getting an error 'expects a contiguous selection when the date column is not unique, has gaps or it contains time portion' 
 
Is there any way around this? 
 
Thanks
1 REPLY 1
johnt75
Super User
Super User

The time intelligence functions need a proper date table to work correctly. Set one up, mark it as a date table and then use that in your slicer, your visuals and your measures.

Helpful resources

Announcements
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.