cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Solution Sage
Solution Sage

How to optimize cacluation to reduce memory use?

Hi all,

 

I'm writing a calculated column for ranking that's giving me the standard "There's not enough memory to complete this operation. Please try again later when there may be more memory available." message.

 

I have two versions, one referencing a measure, one with the measure built into the calculation as a VAR. Both are having the same issue.

 

rank = 
VAR x = 
CALCULATE(SUM('Sales'[Sales Quantity])) /
CALCULATE(SUM('Sales'[Sales Quantity]),ALL('Sales')) RETURN rankx( all('Product'), x)

 

The Sales table has about 7M rows, the Product table only 400. I'm running 20GB of memory on this machine, so I've never had any memory issues before with loading or refreshing data, or creating caluations. Any tips?

 

1 REPLY 1
Resident Rockstar
Resident Rockstar

Hi  @RMDNA,

 

I suggest you could create a calculated column with 

 

CALCULATE(SUM('Sales'[Sales Quantity])) / 
CALCULATE(SUM('Sales'[Sales Quantity]),ALL('Sales'))

then create the rank measure to optimize the calculation.  you could have a try.

 

In addition, you could have a reference of this similar thread to get other tips.

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Wave Release 2

Check out the updates in Power BI.

Overview of Power BI 2020 release wave 2!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors