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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Calculating one average minus another for each value of a column

I have two tables of responses, one provided by an individual, one by their manager. Each looks like this:

Self Table

Person       Attribute         Value

A                 ST1                 6

B                 CB1                 4

C                SB2                   3

D                 SA1                  2

 

Manager Table

Person       Attribute         Value

A                 ST1                 3

B                 CB1                 6

C                SB2                   2

 

I want to calculate the gap between an individual's average responses for each item in the "attribute" column, and their manager's average responses for the same attribute. So I need an expression for average Value (Self) - average value (Manager) for each item in the Attribute column. Can anyone help?

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

Try to it.

Diff = CALCULATE(AVERAGE('self'[Value]),FILTER('self',[Attribute]=MAX('Table'[Attribute])))- CALCULATE(AVERAGE('Manager'[Value]),FILTER('Manager',[Attribute]=MAX('Table'[Attribute])))

The final show:

vyalanwumsft_0-1652938730403.png


Best Regards,
Community Support Team _ Yalan Wu
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
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

Try to it.

Diff = CALCULATE(AVERAGE('self'[Value]),FILTER('self',[Attribute]=MAX('Table'[Attribute])))- CALCULATE(AVERAGE('Manager'[Value]),FILTER('Manager',[Attribute]=MAX('Table'[Attribute])))

The final show:

vyalanwumsft_0-1652938730403.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Also just a quick clarification - I have a 3rd table which looks like this:

 

Attribute         Question

ST1                 What do you think of XYZ?

 

This table is linked 1-Many from the Attribute field to both the Self table and the Manager Table.

 

My ultimate desired output is a table of attribute, question, individual-manager difference which I can filter for each individual.

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