Forum Discussion
Subtotal Divided by Row Value
I'm trying to create a measure which takes the value from each Row, and divides it by the Subtotal to give the Percentage of the Subtotal per row.
I'm currently using this measure, but it just gives a value of 100% for each row, which is wrong.
Resignation Percentage = DIVIDE(COUNT(JoinedDataTable[Reason Code]),CALCULATE(COUNTROWS(JoinedDataTable)))
The below is what it should look like:
As an example, the '18-25' Age Bracket, should calculate as 22 / 204 = 0.1078 (10.78%)
| Age Bracket | Total | % |
| Junior | 1 | 0.49 |
| 18-25 | 22 | 10.78 |
| 26-30 | 18 | 8.82 |
| 31-35 | 7 | 3.43 |
| 36-40 | 6 | 2.94 |
| 41-45 | 8 | 3.92 |
| 46-50 | 8 | 3.92 |
| 51-55 | 7 | 3.43 |
| 56-60 | 6 | 2.94 |
| 61-65 | 8 | 3.92 |
| 66-70 | 15 | 7.35 |
| 71-75 | 20 | 9.80 |
| 76-80 | 24 | 11.76 |
| 81-85 | 27 | 13.24 |
| 86-90 | 18 | 8.82 |
| 91-95 | 5 | 2.45 |
| 96-99 | 1 | 0.49 |
| 100+ | 3 | 1.47 |
| Total | 204 | 100 |
Hi LickNewin
Just small change in formula
Try thisMeasure 2=
var Total= CALCULATE(COUNT(Table[Reason code]),ALLEXCEPT(Table, Table[Reason code])RETURNDivide(Measure1,Total)It would give you expected output!I hope i answered your question!
7 Replies
- LickNewinRegular Visitor
Hey Uzi,
Unfortunately that doesn't work how I wanted.
It works fine when I have all the Reason codes selected in the Filter, but as soon as I filter it, the values are wrong.
- LickNewinRegular Visitor
Here is the link to the PBIX file:
- LickNewinRegular Visitor
Hey Uzi,
It's coming up with an error that says the Syntax for RETURN is incorrect