Forum Discussion
Anonymous
3 years agoNot applicable
Weighted Average shows wrong sum
Hi there, I am struggling with computing the weighted average of deviations. I have a range of deviation from -304 to 88 and the count of how many times one deviation occurs. For example: the deviat...
- 3 years ago
Hi!
Looks to me like SUMX(Table, Table[Deviation] * Table[Weight]) should give your desired result, but maybe not. What result are you getting?
Is "Deviation + Weight" a calculated column? If you SUM() that in a separate measure SUM(Table[Deviation + Weight]), do you get your expected result then?
If you are able to share some sample data it might be easier to help you figure it out.
TomasAndersson
3 years agoSolution Sage
Ah, ok. Would below get you the expected result?
Measure =
sumx('Table',
DIVIDE(
'Table'[Deviation],
[Count deviation all]
)
)
Anonymous
3 years agoNot applicable
I think the measure would sum up the weights, so it should return 1, if I am not mistaken.
I tried some calculated columns, as you recommended, and now I get the correct weighted average. So thanks a lot for your tip.