Forum Discussion
cosminc
Post Partisan
7 years agoAverage Weighted on DAX - sumx
Hi all,
i'm struggling with an average, i translate below a similar example:
Salesmen Sales Duration Year Month
A 10 10 2019 1
A 5 20 2019 2
B 20 3 2019 2
expected results in a table with 2019 selected:
top salesmen
Salesmen Weighted Avg
A sumproduct(Sales,Duration)/sum(Duration)=6.6666
B 20
i tried this but doesn't work
Weighted Avg = sumx(source,source[Sales]*source[Duration])/sum(source[Duration])
Thanks in advance!
Cosmin
- Anonymous7 years ago
This should work:
Weighted Sales = DIVIDE( SUMX(FactSales, FactSales[Sales] * FactSales[Duration] ), SUM ( FactSales[Duration] ) )
4 Replies
- AnonymousNot applicable
This should work:
Weighted Sales = DIVIDE( SUMX(FactSales, FactSales[Sales] * FactSales[Duration] ), SUM ( FactSales[Duration] ) )- cosminc
Post Partisan
Hi,
it doesn't work unfortunately
it gives me same value for each Salesmen
Thanks
- AnonymousNot applicable
Hmm. Looks like it works for me?!