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
jhd
Helper I
Helper I

Date filter having unexpected effect

I have the measure: GBPPRICE_END_FY-1=

 


VAR LASTSALE =
   CALCULATE (
       MAX ( 'Table1'[DATE_REC] ),
       PREVIOUSYEAR ( 'Calendar'[Date], "3/31" ),
       ALL ( Table1[SUPPLIER_GROUP] )
   )
RETURN
    IF (
        Table1[Sum of UNITS_REC] > 0,
        CALCULATE ( [GBPAVGPRICE], ALLSELECTED ( Table1 ), Table1[DATE_REC] = LASTSALE ),
        BLANK ()
    )

           

 

It should show the last price achieved in the previous financial year, and it works, but only if I have my pivot table contains the previous financial year. If I only select the current financial year, the values disappear.

Do I need to all something else to the ALL function? My attempts have so far failed.

Thanks, James

2 REPLIES 2
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @jhd,

 

Could you please mark the proper answers as solutions?

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ashish_Mathur
Super User
Super User

Hi,

 

Does this work?

 

=CALCULATE(MAX('Table1'[DATE_REC]),PREVIOUSYEAR('Calendar'[Date])

 

Drag years to the row/column area of the Table/Matrix visual.

 

If this does not work, then share the link from where i can download your PBI file.


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

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