Forum Discussion
Weighted Distribution calculation
Hi Anonymous,
You can used the below dax measure.
WeightedAvg = var _total=CALCULATE(SUM(Table1[Sales]),ALL(Table1))
var _prodsum=CALCULATE(SUM(Table1[Sales]))
Return
_prodsum/_total
You can find the pbix file here.
If this helped you, please mark this post as an accepted solution and like to give KUDOS .
Regards,
Affan
Hi affan,
Thanks for the reply!
Unfortunately, this is not what I am asking for.
In your pbi-file for product1 weighted distribution is 26.67% but it should be 37.78%, numerator should be 68 not 48 (24+24+20).
I need to sum total sales of clients where product1 was sold. It means that I sum not only product1 but produt2 for client 100070.
- affan7 years agoSolution Sage
Hi Anonymous,
Please see the attached PBIX file update with your requirement. I have created a calculated column to calculate your desired result.
If this helped you, please mark this post as an accepted solution and like to give KUDOS .
Regards,
Affan
- Anonymous7 years agoNot applicable
- Anonymous7 years agoNot applicable
- affan7 years agoSolution Sage
Anonymous
I have created a custom column
CustSum = CALCULATE(SUM(Table1[Sales]),FILTER(ALL(Table1),Table1[Client]=EARLIER(Table1[Client])))
Then I have created the following measure
WeightedAvg = var _total=CALCULATE(SUM(Table1[Sales]),ALL(Table1)) var _prodsum=CALCULATE(SUM(Table1[CustSum])) Return _prodsum/_total
Regards
Affan