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

View all the Fabric Data Days sessions on demand. View schedule

Reply
TomStaps
Helper I
Helper I

Calculate average per company, not individual answers

Hello everyone,

 

At this moment I am busy with analyzing data in Power BI. My targets are to:

  • Calculate the average of column A, B, C separate. Where every company counts as 1. I am not interested in the average of all separate answers.
  • The weighted average of all columns (A, B, C). Again, where every company counts as 1. I am not interested in the average of all separate answers.

 

The problem at this moment is that Power BI shows the average per company in rows, but not in the outcome of the average calculation.

 

Current (wrong) calculation in Power BI for column A:

  • X: 3 + X: 4 + Z: 4 = 11 à 11/3=3,67

 

Calculations that I need for column A:

  • Company X: 3 + 4 = 7 à 7/2= 3.5
  • Company Z: 4
  • Average = X: 3.5 + Z: 4 = 7.5 à 7.5/2= 3.75
  • Blank cells need to be ignored.

 

Overview data:

TomStaps_0-1638525236589.png

 

Current (wrong) outcome in Power BI:

TomStaps_1-1638525249539.png

 

 

Outcome I need:

TomStaps_2-1638525258869.png

 

 

Does someone know how it would be possible to show the right outcome in PowerBI?

Thanks in advance. If you need more explanation, please let me know.

 

Best Regards,

Tom

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @TomStaps ,

Here are the steps you can follow:

1. Create measure.

A_Measure =
var _summrize=SUMMARIZE('Table','Table'[Company],"A",AVERAGE('Table'[A]),"B",AVERAGE('Table'[B]),"C",AVERAGE('Table'[C]))
RETURN
IF(
    HASONEVALUE('Table'[Company]),AVERAGE('Table'[A]),AVERAGEX(FILTER(_summrize,[A]<>BLANK()),[A]))
B_Measure =
var _summrize=SUMMARIZE('Table','Table'[Company],"A",AVERAGE('Table'[A]),"B",AVERAGE('Table'[B]),"C",AVERAGE('Table'[C]))
RETURN
IF(
    HASONEVALUE('Table'[Company]),AVERAGE('Table'[B]),AVERAGEX(FILTER(_summrize,[B]<>BLANK()),[B]))
C_Measure =
var _summrize=SUMMARIZE('Table','Table'[Company],"A",AVERAGE('Table'[A]),"B",AVERAGE('Table'[B]),"C",AVERAGE('Table'[C]))
RETURN
IF(
    HASONEVALUE('Table'[Company]),AVERAGE('Table'[C]),AVERAGEX(FILTER(_summrize,[C]<>BLANK()),[C]))

2. Result:

vyangliumsft_0-1638945094232.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi  @TomStaps ,

Here are the steps you can follow:

1. Create measure.

A_Measure =
var _summrize=SUMMARIZE('Table','Table'[Company],"A",AVERAGE('Table'[A]),"B",AVERAGE('Table'[B]),"C",AVERAGE('Table'[C]))
RETURN
IF(
    HASONEVALUE('Table'[Company]),AVERAGE('Table'[A]),AVERAGEX(FILTER(_summrize,[A]<>BLANK()),[A]))
B_Measure =
var _summrize=SUMMARIZE('Table','Table'[Company],"A",AVERAGE('Table'[A]),"B",AVERAGE('Table'[B]),"C",AVERAGE('Table'[C]))
RETURN
IF(
    HASONEVALUE('Table'[Company]),AVERAGE('Table'[B]),AVERAGEX(FILTER(_summrize,[B]<>BLANK()),[B]))
C_Measure =
var _summrize=SUMMARIZE('Table','Table'[Company],"A",AVERAGE('Table'[A]),"B",AVERAGE('Table'[B]),"C",AVERAGE('Table'[C]))
RETURN
IF(
    HASONEVALUE('Table'[Company]),AVERAGE('Table'[C]),AVERAGEX(FILTER(_summrize,[C]<>BLANK()),[C]))

2. Result:

vyangliumsft_0-1638945094232.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

lbendlin
Super User
Super User

@TomStaps  You have two identical rows  - that will not work in Power BI as it always automatically aggregates.  I have added an index column to mitigate that.

 

See attached.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors