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
papanovn
Frequent Visitor

Min date by expression evaluation disregarding date filter

Hello.

I have a table with sales. I have to find the first order date for every customer, but only for orders where amount is bigger than zero. I've used CALCULATE with ALL condition to find the first date disregarding any filters by period. When I include FILTER([Order]; SUM([Order Amount])>0) it stops working because the expression is affected by the date filter. Puting ALL in the expression filter doesnt help. Any ideas?

Here is my current measure. CALCULATE(MIN('Order'[Order Date]); ALL('Calendar'[Year]))
Here is something like what should i do:
CALCULATE(MIN('Order'[Order Date])

; ALL('Calendar'[Year])

; FILTER('Order Row'; SUM('Order Row'[Sold Amount User (EUR)])>0)

)

3 REPLIES 3
v-ljerr-msft
Employee
Employee

Hi @papanovn,

 

Could you try the formula below? It should work.

=
    CALCULATE (
        MIN ( 'Order'[Order Date] );
        FILTER ( ALL ( 'Order Row' ); SUM ( 'Order Row'[Sold Amount User (EUR)] ) > 0 )
    )

If that is not the case, please post your table structures and relationships between your tables for better assistance.Smiley Happy

 

Regards

Hi @v-ljerr-msft,
the matrix crashes with this measure. It calculates for long time and then says "something went wrong".
I have added "Order Date" in "Order Row" so I have all the fields in one table now.

Hi @papanovn,

 

For further troubleshooting this issue, could you share a sample pbix file which can reproduce the issue? You can upload it to Onedrive or Dropbox and post the link here. Do mask sensitive data before uploading.Smiley Happy

 

Regards

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.