Forum Discussion
Dynamic percentage based on attributes applied
- Anonymous8 years ago
Ok great, the formatting must have been the elusive element.
Doing some quick maths:
208764.42 / 37968039.17 = 0.005498425. As a percentage that should be 0.54%. So that means you are correct in that its 100 times too small, plus the number itself is wrong.
Lets create 2 more measures.Numerator = SUM('YourTable'[SumActualCost]) Denominator = SUM('YourTable'[Total Cost])Bring those into the matix next. I'm curious what that comes up with.
For the reason the reason it doesn't add to 100%, i believe My error is with Total Cost. Instead of SUM for the Denominator, we should use MAX instead. This is because you don't actually want to sum up that column.
- Anonymous8 years ago
No definately not, thats not necessary. Does your formula now look like?
Simple % = DIVIDE( [Numerator], [Denominator] )Remembering Numerator and Denominator are measures, so we can call them directly in our new Measure.
Just to clarify, The matrix visual in your screen shot has each item entirely from this single grouped table?
What does it look like if you bring the Measure onto your table, so you get a row by row result?
Is the table used for the matrix visual the same table referenced by the measure?
I've just changed the Format of the Measure to "Percentage" and now I'm seeing numbers but the total is 0.0087184% (shouldn't this be 100%?) and the row values aren't correct (see screenshot for example). I've tried multiplying the measure by 100 and this seems closer to what it should be, but as you can see below, a percentage for 2.3m is lower than 350k...?
- Anonymous8 years agoNot applicable
Ok great, the formatting must have been the elusive element.
Doing some quick maths:
208764.42 / 37968039.17 = 0.005498425. As a percentage that should be 0.54%. So that means you are correct in that its 100 times too small, plus the number itself is wrong.
Lets create 2 more measures.Numerator = SUM('YourTable'[SumActualCost]) Denominator = SUM('YourTable'[Total Cost])Bring those into the matix next. I'm curious what that comes up with.
For the reason the reason it doesn't add to 100%, i believe My error is with Total Cost. Instead of SUM for the Denominator, we should use MAX instead. This is because you don't actually want to sum up that column.
- Anonymous8 years agoNot applicable
I've created those measures, do you want me to replace them in the % measures now? I can't seem to select measures in the formula.
The measures now return the same results as follows:
SumActualCost = Numerator
Total Cost (when values aren't aggregated) = Denominator
- Anonymous8 years agoNot applicable
Excellent. Try changing your % measure to use the numerator and denominator. Curious at the result.