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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Soles01
New Member

Function 'SAMEPERIODLASTYEAR' expects a contiguous

Hello friends, how are you, I hope very well, I bring the following problem that I think there are already many posts but I have not been able to solve it, I am creating a relationship of current sales VS previous sales (1 year), using the 'SAMEPERIODLASTYEAR' function but it returns an empty value, I use the formula "Ventas año Anterior = CALCULATE ([ventas año anterior],SAMEPERIODLASTYEAR(Dates[Date]))" and it doesn't work, I already have an exclusive table for dates made with the formula "Dates = CALENDARAUTO ()" my relationship with the sales data table is *:1, so it should work, I can't get the data, then I will place the respective images.

another data, I am acquiring the information from SQL server, with a custom script

 

I hope someone can help me, thank you very much in advance

 

PBI1.JPG 

PB3.JPG

PB4.JPG

PBI2.JPG

PBI5.JPG

    

 

3 REPLIES 3
PaulDBrown
Community Champion
Community Champion

Try changing the data type in your date table to Date (and make sure the data type in the sales table is also type Date).

Also make sure the fields in the slicer and the visual are from the Date table





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Hi PabloBrown

Indeed, the fields are of type date as it should be, I don't know if it has something to do with the fact that I import the data from a database with SQL, the data in the date is not continuous, since it skips days such as non-working days or holidays

Have you changed the data type for the date field in the Date table? The image you posted shows the data type as Date/Time and not Date





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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