Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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!
Instead of nesting FILTER calls, Putting a direct filters on CALCULATE can significantly improve the performance of your measure.
Thanks & Regards,
Bhavesh
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.
This is sample data. Only one table is used for this particular calculation.
User | Count |
---|---|
119 | |
78 | |
59 | |
52 | |
48 |
User | Count |
---|---|
171 | |
117 | |
61 | |
59 | |
53 |