Forum Discussion
Anonymous
9 years agoNot applicable
calculating weighted average
Hello all , I want to have a dax formula to calculat the weighted average for the next scenario. i have 10 participants , which 8 participants scored a 1 and 2 participants scored a 4. So...
- 9 years ago
If Scores is your table then
Measure = SUM(Scores[Score])/COUNTROWS(Scores)
should do it. Your formula is equivalent to just summing up the scores column and divide by number of rows, right?
Molotch
Helper II
9 years agoNot sure I follow you. Why would you go through the trouble grouping the 1:s and 4:s and then calculate a weighted average when you have all the individual scores and can just use a straight average?
If you have the average and weight in a table you can use SUMX to do a row by row calculation where you multiply your average with the weight and then divide the result by the SUM of the weights. That will calculate the weighted average. Ie SUMX(table, average*weight)/SUM(weight).
It can be quite slow though since it iterates all rows in the table.