Forum Discussion
Weighted Averages
Hello,
I hope this might help you to solve your problem.
Weighted =
SUM ( 'Table'[weight] )
/ (COUNTROWS('Table') - COUNTROWS(FILTER('Table','Table'[weight]=0)))
- Anonymous6 years agoNot applicable
Thanks but that doesn't work either. Here is an example:
Customers supply their yearly income and their age.
Not all of the customers supply their age but do supply their yearly income.
I would want to take the weighted average of the age of customers by their incomes. For customers who don't supply their age I want to exclude their income and the entire row in the calcuations. Within Excel it would be (Age*Yearly Income)/Yearly Income after deleting all of the rows of the customers who didn't supply their age. So basically I would want PowerBI to exclude the rows where the age is blank and only do the function on rows with both data sets in the query.