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
DriesW
New Member

Time Intelligence Contiguous Date Selections

Hi Everyone,

 

I have seen that this is an issue that many have already posted about, however, unfortunately I am not able to solve my problem. I have defined a measure, Retails, which counts the amount of retails from the database by filtering on order status (see below):

Retails := CALCULATE(COUNT(fData[ProductionNumber);fData[OrderStatus]=50))

Next to this, my data model consists out of a calendar table ranging from the first of January 2014 up to the 31st of December 2018, in which the datekey column ('Date'[DateKey]) is of the type date and the whole table is also marked as my date table.

 

To make a year over year comparison I have defined the 'Previous Year retails' measure as:

PY Retails := CALCULATE([Retails];SAMEPERIODLASTYEAR('Date'[DateKey])

Somehow this lands me at the 'contiguous date selections'-error and I am unable to see why or how! Using this method to calculate the PY sales has always worked. Somehow in this case it doesn't. I have checked in my fact table and every date is contained in the calendar datekey. I was thinking that this maybe has to do with the fact that there was one retail on the 29th of February 2016 and then when shifting back it doesn't find that same date in 2015?

 

I have added a picture of my data model. As you can see it consists of only three tables, in which I use the Months table to define the monthNames. In the rows of my pivotTable I have put the Month column. 

DataModel.png

Thank you for your help!

1 REPLY 1
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @DriesW,

 

I didn't get such an error message when testing the same measure formula in my desktop. If possible, could you please share the .pbix file?

 

Besides, please have a look at this similar thead: Lab 2 SAMEPERIODLASTYEAR Only works with contiguous date selections

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.