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
nmaddock
Helper I
Helper I

Adding a fixed value crashes my measure

Hi,

 

I'm trying to add a fixed value to my GP Per Lift measure. The measure below works, but if i add a fixed value of 3.5 it crashes my report.

 

1.jpg

 

This measure has a fixed value:

2.jpg

 

The below measure crashes my report. 

3.jpg

 

Please find the link to my report below any help is much appreciated.

https://www.dropbox.com/s/n2fvokgrte5wvxg/Power%20BI%20Sample.pbix?dl=0

1 ACCEPTED SOLUTION
d_gosbell
Super User
Super User

Returning constants from measures is generally a very bad idea. If you have 1000 customers 1000 products and 2 years worth of data (so 730 days) and you drag the product, customer and date onto a table with the operational cost measure the table will attemtp to return a row for every combination (so 1000 x 1000 * 730) which would be 730 million rows.

 

So I would suggest doing something like the following where you check if the measure is not blank before adding the constant value to it.

 

GP per Lift (excluding rent & doc) =
VAR _operationCost = 3
VAR _part1 = [Lift Rate] - [Disposal Cost per Lift]
RETURN IF( NOT( ISBLANK( _part1 ) ), _part1 + _operationCost )

View solution in original post

1 REPLY 1
d_gosbell
Super User
Super User

Returning constants from measures is generally a very bad idea. If you have 1000 customers 1000 products and 2 years worth of data (so 730 days) and you drag the product, customer and date onto a table with the operational cost measure the table will attemtp to return a row for every combination (so 1000 x 1000 * 730) which would be 730 million rows.

 

So I would suggest doing something like the following where you check if the measure is not blank before adding the constant value to it.

 

GP per Lift (excluding rent & doc) =
VAR _operationCost = 3
VAR _part1 = [Lift Rate] - [Disposal Cost per Lift]
RETURN IF( NOT( ISBLANK( _part1 ) ), _part1 + _operationCost )

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.