Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Joswin_100
Frequent Visitor

Insufficient memory

Good afternoon,

I ask for your help,

I have the following error:

"There is not enough memory to complete this operation."

This error comes out when integrating the following function into a table and selecting all products:

Purchase $-SUMX(SO,[Quantity_SO]*[Purchase_Cost_TOPN]) // the goal is to get a purchase amount per product. The units sold by the purchase price (average of the last 5 purchases).

Quantity sold (Quantity_SO) - SUM(SO[ITEM_COUNT]) //sum of parts sold
Average purchase price last 5 purchases (Purchase_Cost_TOPN)-IF(HASONEVALUE(Items[ITEM_ID]),AVERAGEX(CALCULATETABLE(TOPN(5,PO,PO[CREATE_DATE]),PO[ITEM_UNIT_PRICE]&>0,FILTER(ALL('Dim_Calendar DAX'[Date]),'Dim_Calendar DAX'[Date]<-MAX('Dim_Calendar DAX'[Date]))),PO[ITEM_UNIT_PRICE]))

My model is integrated with 4 tables: SO(sales), Items, PO(purchases), Calendar (dates) /annex image of my model

The granularity level of my OS and PO tables is per day.

Tables have the following rows: items (73774 rows) / OS (3,248,016 rows) / PO(561,165 rows)

The actions I have taken to avoid this error are:

-Delete columns that are not needed

-Clear cache in options>data load> Clear cache

-Increase the maximum allowed (MD) to 16000 in options>data load> maximum allowed

I'm using direct query to bring information from a netsuite odbc (ERP)

But I'm still with the same mistake 😞

1 ACCEPTED SOLUTION
v-diye-msft
Community Support
Community Support

Hi @Joswin_100 

 

Please kindly refer to the blog to fix the issue:

https://thegeekpage.com/fixed-there-is-not-enough-memory-to-complete-this-operation/

 

Besides,To debug this do the following:

  1. Download and install Dax Studio http://daxstudio.org/
  2. In you Power BI report create a blank report page and save the desktop file with this page open/selected
  3. Close All Power BI desktop sessions
  4. Start Power BI desktop again and open only this report LEAVE IT on the blank page!
  5. Start DAX Studio and connect it to the Power BI Desktop file you have issues
     

    03.png

  6. In DAX Studio click the ALL Queries button
     

    51dd9cbc-0fe0-4ab8-80bf-f3fa1dbef49f.png

  7. Wait until output windows shows
     

    59eb2b9c-3116-45eb-9e3e-543e9a19461e.png

  8. Now go to Power BI and start doing what you do while you are getting the memory error...
  9. When you have it return to DAX Studio and see what is on the All Queries page of your query trace…
     

    a4693605-9bae-44c2-b70b-c0fda6127fae.png

  10. Find your longest running queries and analyze them…
Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

2 REPLIES 2
v-diye-msft
Community Support
Community Support

Hi @Joswin_100 

 

Please kindly refer to the blog to fix the issue:

https://thegeekpage.com/fixed-there-is-not-enough-memory-to-complete-this-operation/

 

Besides,To debug this do the following:

  1. Download and install Dax Studio http://daxstudio.org/
  2. In you Power BI report create a blank report page and save the desktop file with this page open/selected
  3. Close All Power BI desktop sessions
  4. Start Power BI desktop again and open only this report LEAVE IT on the blank page!
  5. Start DAX Studio and connect it to the Power BI Desktop file you have issues
     

    03.png

  6. In DAX Studio click the ALL Queries button
     

    51dd9cbc-0fe0-4ab8-80bf-f3fa1dbef49f.png

  7. Wait until output windows shows
     

    59eb2b9c-3116-45eb-9e3e-543e9a19461e.png

  8. Now go to Power BI and start doing what you do while you are getting the memory error...
  9. When you have it return to DAX Studio and see what is on the All Queries page of your query trace…
     

    a4693605-9bae-44c2-b70b-c0fda6127fae.png

  10. Find your longest running queries and analyze them…
Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
Joswin_100
Frequent Visitor

But when filtering a product, the function runs well (image annex)

In the salt table, the "buy $" column makes me the multiplication line by liea and the total makes me the sum of all the rows.

The buy order table, I leave it comp reference, basically in this table I get the average price of the last purchasesTabla.PNG

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.