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
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
Employee
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
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.