Forum Discussion
Average based on total population
First, for the average part:
use the CALCULATE function and ALL or ALLSELECTED as follows:
AvgSales = DIVIDE(CALCULATE([Sales],ALLSELECTED(Data));'Data[Distribution]))
Now for placing the average instead of zeros, you can use a measure in the table instead of the Sales column:
_Sales = if(SELECTEDVALUE(Data[Sales]) = 0, [AvgSales], SELECTEDVALUE(Data[Sales]))
It would be better if you share the pbix file so that I make sure the calculations are correct
- depple7 years agoHelper III
Hi yelsherif ,
Thank you for your suggestion.
I was just about to delete my post, as I managed - by extensive trial & failure - to come up with a working solution. Unfortunately I immediately struck a new problem, because my matrix's vertical sums is returning values that appear to be - if not - close to averages. I have never experienced that before, so I guess that I could have something to do with the extremely homemade measures. I will try your measures, surely they are better, and maybe that'll do the trick!