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
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
Super User
Super User

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
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.

Top Solution Authors