Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jeanramonyap
Helper I
Helper I

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 7
ddpl
Solution Sage
Solution Sage

@jeanramonyap Could you please share your expected result in table.

SupplierAverage score
Supplier A22.5
Supplier B30
Supplier C22.5
Supplier D30

@jeanramonyap , 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.

ddpl
Solution Sage
Solution Sage

@jeanramonyap  try this

 

ddpl_0-1662454873804.png

 

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

@jeanramonyap  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

Tried it but since there are multiple Suppliers, it's not possible to use EARLIER here

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.