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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
DylanEvans
Frequent Visitor

Custom rollup calculation for measure

TL;DR: measure is correct at the lowest row, but rollup is wrong.  

 

I have a series of dependent measures that cross 3 intermediate 1:many tables. All tables have static data, but I'm using measures so users can select rows in the yellow table and see the resulting measure in the blue table.  The connecting measures (green, pink, and orange) use multiplying operations because I'm compounding probabilities of different scenarios. 

 

DylanEvans_2-1670522286997.png

Measures calculations: 

  • threats (pink) adjusted_prob = product(threats[base probability]) * if(ISFILTERED('projects'),productx('projects-threats','projects-threats'[probability]),1)
  • threats-productrisks (green) adj_effect = product('threats-productrisks'[probability]) * productx('threats',[adjusted_prob])
  • product-risks (blue) this_cost = IFERROR(sumx('product-risks','product-risks'[cost]*[adj_effect]),0) 

The measure works correctly at the row-level of the blue table.  I would like to be able to group via a matrix visual by the two far-left tables, but the rollups are incorrect. I will never use the rollups of the intermediate orange, pink, or green measures; they are all the product of the rollups. For example, for the revenue orange rollup, it would be 0.0000079%=(.017*.035*.042*.0504*.063).  I would like rollups of the blue to be a (scaled) sum of the blue rows - in this case, maybe 13k. What happens instead is that the rollup is the same math, except applied only with the rollup numbers: almost 0.

 

DylanEvans_0-1670533714157.png

 

 

As long as I'm dreaming big, I'd also like to scale the blue rollup, because the cost of several scenarios occuring is less than the sum of each individually happening.  maybe rollup = maxx(costs) * sum(1+ individual_cost/((.25 + indidual_cost/maxx(costs)).

Any ideas? 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@DylanEvans First, please vote for this idea: https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e

This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

Also: https://youtu.be/uXRriTN0cfY
And: https://youtu.be/n4TYhF2ARe8



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
DylanEvans
Frequent Visitor

Figured it out. I was summarizing by the wrong field.  


Greg_Deckler
Community Champion
Community Champion

@DylanEvans First, please vote for this idea: https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e

This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

Also: https://youtu.be/uXRriTN0cfY
And: https://youtu.be/n4TYhF2ARe8



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

That sounds like exactly the issue and your solution even gives me the flexibility to scale the summing.


New measure: 

 

this_cost_total = 
VAR _table = summarize('product-risks','product-risks'[risk],"_value",[this_cost])
RETURN
IF(HASONEVALUE('product-risks'[risk]),[this_cost],sumx(_table,[_value]))

 

 @Greg_Deckler Unfortunately, the solution didn't seem to work for me: the new measure has the same rollups as the original row-level. 

DylanEvans_0-1670592209022.png

 

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.