Forum Discussion
Weighted Average shows wrong sum
- 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.
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.
- Anonymous3 years agoNot applicable
Hi,
thanks for your reply.
As of now I only have measures. I will try to calculate with calculated columns. If this wont help, I'll try to share sample data.
- TomasAndersson3 years agoSolution Sage
Ah, ok. Would below get you the expected result?
Measure = sumx('Table', DIVIDE( 'Table'[Deviation], [Count deviation all] ) )- Anonymous3 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.