Difficult to understand which weighted avg you want.
Could you give me example of expected value?
in the example above, tableau is calculating an average using sum (cost) divided by number of location so sum(120,260,50)/3 to get average cost.
i want the average cost to be weighted based on number of customers for each location. so like this: (number of customers/total number)*cost
so it will be like this: weighted average: (10/35)*120+(20/35)*260+(5/35)*50=34.28+148+7=189
i have million of rows in my workbook so so many locations and products and i can't apply the logic above to calculate a weighted average
does this make sense?
this is great. Thanks!
You are welcome.