Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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 |
Solved! Go to Solution.
Hi @LickNewin
Just small change in formula
Try this
Measure 2=
var Total= CALCULATE(COUNT(Table[Reason code]),ALLEXCEPT(Table, Table[Reason code])
Hi @LickNewin
Just small change in formula
Try this
Measure 2=
var Total= CALCULATE(COUNT(Table[Reason code]),ALLEXCEPT(Table, Table[Reason code])
Hey Uzi,
It's coming up with an error that says the Syntax for RETURN is incorrect
I think i figured it out - it was missing a closing bracket after the ALLEXCEPT
Seems to be working now!!
Thanks for your help 🙂
hi @LickNewin
you missed the closing bracket ) this one
hi @LickNewin
Try below dax for measure
Measure 1= Count ( Table[Reason code])
Measure 2=
var Total= CALCULATE(COUNT(Table[Reason code]),ALL(Table))
I hope I answered your question!
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.