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
ovonel
Post Prodigy
Post Prodigy

Precedence filter or SAMEPERIODLASTYEAR?

I see in a .pbix  the next filter page:   IsCurrentFY is 1

 

And… I also have the next measure for Last Year:   CALCULATE( xyz, SAMEPERIODLASTYEAR( 'Date'[Date] ) )

 

The visualization displays correctly; comparing xyz this year vs last year… I am wondering…

 

Why  IsCurrentFY is 1  doesn’t take precedence? Is it that SAMEPERIODLASTYEAR overrides any filter?

2 REPLIES 2
amitchandak
Super User
Super User

@ovonel , I not sure I clear with your question, but this calculation means

CALCULATE( xyz, SAMEPERIODLASTYEAR( 'Date'[Date] ) )

 

CALCULATE( xyz, filter(all('Date') , Date[Date] in <all last year date> ) )

 

refer

http://dataap.org/blog/2019/04/22/difference-between-calculate-with-and-without-filter-expression/

Yes, correct. My question is, what happens when you have a filter that wants to only display this year's data and a function like SAMEPERIODLASTYEAR explicitly trying to fetch last year's data...

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.