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
ALRUYOYO
Advocate I
Advocate I

Filter limitations working with large tables

Hi,

 

I have a table of completed orders and I want to calculate orders to date (OTD) for each visitor.
I have written this formula:

OTD =
VAR VID = 'powerbi CompletedOrders'[VisitorId]
VAR OID = 'powerbi CompletedOrders'[OrderId]
RETURN
CALCULATE (
COUNT('powerbi CompletedOrders'[OrderId]),
FILTER (
'powerbi CompletedOrders',
'powerbi CompletedOrders'[VisitorId]=VID),
FILTER (
'powerbi CompletedOrders',
'powerbi CompletedOrders'[OrderId]<OID))

I get this error: "The operation has been cancelled because there is not enough memory available for the application."

I understand that my table is too big (200k+ rows) for double Filter. I was looking how to write something similar to LOOP function in DAX but with no success.

I would love to hear your suggestions for a workaround.

Thanks!

4 REPLIES 4
BhaveshPatel
Community Champion
Community Champion

Instead of nesting FILTER calls, Putting a direct filters on CALCULATE can significantly improve the performance of your measure. 

 

Thanks & Regards,

Bhavesh

 

 

 

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

Thank you for your answer BhaveshPatel. But could I am not sure I understand how to do it.
Could you edit my function to illustrate your suggestion?

Can you please share the screenshots of your data model and sample data if possible. This will help me to provide you an exact solution.

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

Sample data.png

This is sample data. Only one table is used for this particular calculation.

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.