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
RMDNA
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
v-piga-msft
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
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.