Forum Discussion
Anonymous
7 years agoNot applicable
Weighted Distribution calculation
Hello, Could you please help me to calculate weighted distribution using DAX? I have the following table: Client Products Sales 100042 product1 24 100070 product2 20 100070...
affan
7 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
Anonymous
7 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
- Anonymous3 years agoNot applicable
Hi affan
Many thanks for this!
it works fine if I only look at one day but I have years with data and I want to to show the % if I change from one day to 3 years (or what ever date/week/month/year)?
Many thanks,
Andreas