cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
anagnostes
Frequent Visitor

Memory issues with filter

Hi,

 

I have a MODEL where I have a Customers table and an Orders Table. I want to add a new mesure in the Customers table where i want to compute the average buying cyle. So i add this DAX mesure:

 

 

    BUYING_CYCLE = 
            AVERAGEX(ORDERS; 
                    DATEDIFF( CALCULATE
                        MAX ( 'ORDERS'[ORDER_DATE] ) ;
                            FILTER(ORDERS; EARLIER('ORDERS'[ORDER_DATE]) >= 'ORDERS'[ORDER_DATE] )
                    ); 'ORDERS'[ORDER_DATE]
                    ; DAY )
            ) 

 

This works fine but it's not correct. I should add a second filter like this:

 

FILTER(ORDERS; EARLIER('ORDERS'[ORDER_DATE]) >= 'ORDERS'[ORDER_DATE] ) && EARLIER('ORDERS'[ID]) <> 'ORDERS'[ID] )

 

But if I add this second expression the query is really slow and the memory gets to 98 plus %.  There aren't a lot of records in the Orders table, like 25000. 

 

Can anybody tell me how can i understand what is happening here?

 

Thank you.

 

1 REPLY 1
majdkaid22 Helper V
Helper V

Re: Memory issues with filter

@anagnostes I had a similar issue and my table was around the same size of rows. 

 

The problem is with how many columns your table has. You need to try to shape it down and minimize the number of columns or increase the RAM on the pc running the PBI desktop. I upgraded to 16GB Ram and that helped very well.

Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

April 2020 Community Highlights

April 2020 Community Highlights

Info on our Super Users, MBAS content and badges, and updates to our support articles. - Read the full Community Highlights.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.