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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
JakobH
Frequent Visitor

Memory error in "simple" measure calculation

Hello

 

I need to calculate a discount of a price. The problem is, that the [ReferencePrice] is a measure in itself, which is why i can not add a calculated column.

When i create a measure to calculate the discount i run into "out-of-memory"-errors. Interestingly only the subtraction part of the calculation seems to be the issue.

 

No Problem:

Discount =
CALCULATE (
    DIVIDE ( SELECTEDVALUE ( FactPrice[Price] ), [ReferencePrice], 0 )
)
 
Not enough Memory:
Discount =
CALCULATE (
    1-DIVIDE ( SELECTEDVALUE ( FactPrice[Price] ), [ReferencePrice], 0 ) 
)
 
Any hints about what is going on here and how i can fix it are much appreciated.
Thank you!
2 REPLIES 2
andhiii079845
Solution Sage
Solution Sage

Try:

 

Discount =
VAR _div = 
CALCULATE (
    DIVIDE ( SELECTEDVALUE ( FactPrice[Price] ), [ReferencePrice], 0 )
)
Return 1-_div




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks for the suggestion, but unfortunately it doesn't work. I can return the VAR but not 1-VAR.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.