Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

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:

SupplierStudy numberScore
Supplier A00115
Supplier A00230
Supplier B00115
Supplier B00345
Supplier C00415
Supplier C00530
Supplier D00230

7 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for your relpy but it's giving me the wrong values. I was thinking more of a calculated column.

      • ddpl's avatar
        ddpl
        Icon for Solution Sage rankSolution 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's avatar
    ddpl
    Icon for Solution Sage rankSolution Sage

    Anonymous Could you please share your expected result in table.

    • Anonymous's avatar
      Anonymous
      Not applicable
      SupplierAverage score
      Supplier A22.5
      Supplier B30
      Supplier C22.5
      Supplier D30
      • ddpl's avatar
        ddpl
        Icon for Solution Sage rankSolution 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.