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