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.
Would a simple measure such as this do the trick:
Simple % = DIVIDE(
SUM('YourTable'[SumActualCost]),
SUM('YourTable'[Total Cost])
)The results returned are all zero :smileysad:
- Anonymous8 years agoNot applicable
Where are you putting the measure to be displayed? What filter contexts are used? Getting zero in this manner makes me suspect there is another element in play here.
- Anonymous8 years agoNot applicable
The measure is created within this table. Which was originally two tables, but merged together in the Query Editor and then I used the Group By function and specified these columns, and aggregated the Actual Cost. No filters have been applied. The visual I'm viewing the result in is a table, and I had to specify the Total Cost column to "Don't Summarize".
- Anonymous8 years agoNot applicable
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?