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...
Anonymous
7 years agoNot applicable
affan
7 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