Forum Discussion
Anonymous
4 years agoNot applicable
Average by group
What is the best way to calculate average score in this scenario? I want to calculate the average by supplier so for
supplier A: (15+30) / 2 = 22.5
supplier B: (15+45) / 2 = 30
Sample data:
| Supplier | Study number | Score |
| Supplier A | 001 | 15 |
| Supplier A | 002 | 30 |
| Supplier B | 001 | 15 |
| Supplier B | 003 | 45 |
| Supplier C | 004 | 15 |
| Supplier C | 005 | 30 |
| Supplier D | 002 | 30 |
7 Replies
- ddpl
Solution Sage
Anonymous try this
- AnonymousNot applicable
Thanks for your relpy but it's giving me the wrong values. I was thinking more of a calculated column.
- ddpl
Solution Sage
Anonymous try this calculated column
Average = var _sum = CALCULATE(SUM('Table'[Score]),ALL('Table'),'Table'[Supplier] = EARLIER('Table'[Supplier]))
var _count = CALCULATE(COUNT('Table'[Supplier]),ALL('Table'),'Table'[Supplier] = EARLIER('Table'[Supplier]))
return
_sum / _count
- ddpl
Solution Sage
Anonymous Could you please share your expected result in table.
- AnonymousNot applicable
Supplier Average score Supplier A 22.5 Supplier B 30 Supplier C 22.5 Supplier D 30 - ddpl
Solution Sage
Anonymous , I think your requirement is too hard for me, I might be incompetent for resolving your problem. I kindly requested you to raise new ticket to get your solution from other mighty community members.
I'm sorry.