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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

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

@Anonymous , 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/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.