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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Dates filter when computing Value with SAMEPERIODLASTYEAR DAX

Hi PBI, prior to selecting filters the data in Matrix looks like this.. 

Sales $ LFY = CALCULATE(SUM(Sheet1[Sales$]),SAMEPERIODLASTYEAR(Sheet1[Month]))

When I select the 3 mths in the "Month FILTER", the table looks fine

When I select the "Quarter filter"...  the [Sales LFY] is missing

 

ASK - Is there a way where I can use either Month OR Quarter filters, without havig to create another New Measure = Sales $ LFY = CALCULATE(SUM(Sheet1[Sales$]),SAMEPERIODLASTYEAR(Sheet1[Fiscal Quarter]))

1.JPG2.JPG2.JPG3.JPG

 

 

 

 

 

 

 

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous,


Based on test, I found SAMEPERIODLASTYEAR function works not so smooth when filter on other fields.

When you choose items, you need to manually select the related previous records, then the formula will works.

 

Capture2.PNGCapture.PNG

 

Notice: When filter on other columns which calculate based on date column, it also works well.

 

In summary, the function seems work based on the hidden calendar table which generate by date files. If you try to filter with other columns not contains relationship to hidden calendar table, the function will be broken.

 

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Solution Authors