Forum Discussion
Gladiator909
Helper I
3 years agoUnderstanding Percentages - Calculating future value
Hi guys,
I am stuck on what should be a pretty straight forward dax measure. I am hoping I can get some clarity on how the percentages work in Power BI. Here is my table:
| Marble Color | Previous Amount | Recovered | Processed |
| Blue | 200 | 20 | 50 |
| Green | 300 | 40 | 120 |
| Red | 150 | 10 | 100 |
| Yellow | 100 | 30 | 60 |
I am calculating the recovery rate as follows:
Recovery Rate = divide(sum('Table'[Recovered]),sum('Table'[Processed]))
And it is a percentage
And now I need to calculate the "projected value": [Previous Amount] * Recovery Rate
This is the DAX for that:
Projection = sum('Table'[Previous Amount]) * [Recovery Rate]
Here is the visual that this gives me:
What I would like the "Total Projection" card to return instead is (80 + 100 + 15 + 50) = 245
Now I do understand that the way Power BI is calculating the recovery rate is basically summing all the recovered marbles and dividing by all the processed marbles and coming up with a % and using that % value to return me 227.27
Any ideas how to modify the DAX (Projection = sum('Table'[Previous Amount]) * [Recovery Rate])
so that it returns 245 instead?
I know I can create one dax for each marble color and add it all up but that would mean loosing the ability to use a slicer on the chart.
Any help would be greatly appreciated
Thanks
Hey,
Try using SUMX:
Total Projection =SUMX('Table', [Recovery Rate] * 'Table'[Previous Amount])
This evaluate line by line and sum each time.
1 Reply
- LuizKoller
Resolver I
Hey,
Try using SUMX:
Total Projection =SUMX('Table', [Recovery Rate] * 'Table'[Previous Amount])
This evaluate line by line and sum each time.