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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
yaman123
Post Patron
Post Patron

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.