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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
webportal
Impactful Individual
Impactful Individual

Error in SAMEPERIODLASTYEAR

When adding the following measure:

 

valor_líquido_ano_anterior = CALCULATE(SUM('order'[valor_líquido]);SAMEPERIODLASTYEAR('calendário'[data]))

to the matrix:

 

Capturar2.JPG

I get the error:

 

Capturar.JPG

 

The field 'calendario'[data] is a date field calculated with:

CALENDAR (DATE (2012; 1; 1); DATE (2017; 12; 31))

So, it is contiguous and it is in Calendar table, which is related with table 'order'.

 

So, why do I get this error? 

It only showed up in the May-2017 version of PBI Desktop.

5 REPLIES 5
vanessafvg
Super User
Super User

what is your data type?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




The date is field is "Date" type and the measure is "Decimal Number".

@webportal

 

i think the issue might be the bidirectional relationship, if you change it to single, does it still give you teh same issue?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




@vanessafvg same error, single or bi-directional.

@webportal  maybe this thread can help?

 

https://community.powerbi.com/t5/Desktop/Contiguous-date-selection-error-YTD-LY/td-p/55789





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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