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.
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.
Thank you for your help!
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |