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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Cross-filtering failure on SAMEPERIODLASTYEAR

Hi,

 

I have to display current year sales and compare it to last year sales. I created three measures in order to do it:

 

SalesTotal = SUM( Orders[Sales] )
SalesYTD = TOTALYTD( [SalesTotal] ; 'Date'[Date] )
SalesYTDLastYear = CALCULATE( [SalesYTD]; SAMEPERIODLASTYEAR( 'Date'[Date] ) )
 
It works fine!
captureSamePeriodLastYear.PNG
But when I try to filter by Technology (or else) in the bubble chart, I have got this result:
 
captureSamePeriodLastYearFail.PNG
I tried measures separately and it appears that it is SalesYTDLastYear which fail.
Do you know why it reacts like this?
Thanks
1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

My guess is that for Technology, the % in the card visual evaluates to an error.  What is the measure for %?  Also, what error do you get when you click on Voir Les Details?  Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

My guess is that for Technology, the % in the card visual evaluates to an error.  What is the measure for %?  Also, what error do you get when you click on Voir Les Details?  Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Thanks, I did not even think of reading the error message:

MdxScript(Model) (18, 60) Calculation error in the measurement'Orders'[ProfitYTDLastYear] : The "SAMEPERIODLASTYEAR" function expects a contiguous selection when the date column comes from a table on side 1 of a bidirectional relationship.

 

After reading this, I changed the relationship between my tables 'date' and 'orders' as single.

I will search for documentation about "cross-filter direction" (here I found something).

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.