Forum Discussion
Adding Rows Together in Matrix to be Used in a Measure
I am not sure how to even explain without just showing you my issue...ha!
I have 5 rows that make up revenue, and I need to add them together so that I can use that total to calculate the % of revenue for the other lines in my matrix.
I need to use this Revenue total in a calculation to populate a % of revenue for each line item on my income statement.
I am currently using the following to calculate the total:
However, when I use this new measure 'Revenue $' to calculate Results $/Revenue, it only populates the lines that are listed in the 'Revenue $' calculation, see below.
I am pretty sure my issue is in the "Revenue $" calculation, because if I perform the same % revenue calculation and plug a random number in the denominator (i.e. $500,000), the calculation works for all rows.
Any thoughts on what I could be doing incorrectly?
Thanks.
BrendaB , The below one should use allselected or all
like a new measure
calculate([$/Revenue], allselected())
Percent of Total and Percent of SubTotal https://www.youtube.com/watch?v=6jTildcV2ho
https://www.youtube.com/watch?v=cN8AO3_vmlY&t=24270s
3 Replies
- amitchandakSuper User
BrendaB , The below one should use allselected or all
like a new measure
calculate([$/Revenue], allselected())
Percent of Total and Percent of SubTotal https://www.youtube.com/watch?v=6jTildcV2ho
https://www.youtube.com/watch?v=cN8AO3_vmlY&t=24270s- BrendaBFrequent Visitor
This worked! I appreciate the help! Definitely subscribing to your channel, easy to understand!
- Uzi2019Community Champion
Hi BrendaB
for Total revenue you can try below measure:Revenue% =var x= CALCULATE(SUM('Table'[Revenue]),ALLSELECTED('Table'[Year],'Table'[Month],'Table'[Branch Name]))Var y = SUM('Table'[Revenue])Return DIVIDE(y,x,0)Whatever level of hierarchy you are using you have add in all selected (function). in my case 100% i want in Total column then this divides with every cell.I hope you understand the scenario.