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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

SUM Column but Average Values Based on Duplicates in Another Column

AB
0.104945708906
0.864945708908
0.174945708909
0.296041671331
0.226041671331
1.516041671334
1.676041671334
0.226041671337

 

I would like to sum the values in column A, but if there are duplicates in column B, I want to average the values of the duplicates then include that average in the sum.

 

So instead of adding 0.29 and 0.22 as part of the sum of column A, first gather their average = .255 and use that in the total sum instead. Then do the same for 1.51 and 1.67, etc.

1 ACCEPTED SOLUTION
jthomson
Solution Sage
Solution Sage

Should be easy enough with an intermediate summary table, something like:

 

summarize(yourtablename,[column b],"column a averaged",average([column a])

 

You can then sum up your new "column a averaged" column

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

ABC
0.1494570890630
0.864945708908150
0.174945708909 0
0.29604167133190
0.22604167133160
1.516041671334200
1.676041671334220
0.226041671337 0

 

Both solutions work, but what if I have additional columns that I want to SUM

 

Also this is all being done in a UNION(SELECTCOLUMNS( and if possible would like it achieved under "A"

    SELECTCOLUMNS (
        'Table1',
	"A", 'Table1'[A],
        "D", 'Table1'[D],
        "E", 'Table1'[E],
        "C", 'Table1'[C]/60),

 but maybe thats not feasible, or am setting this up wrong.

 

 

Nevermind, the Summarize expression works, I just have to keep adding to it and rebuild my table.

Ruksuro
Helper III
Helper III

I like to use:

 

Average Measure = AVERAGEX(Sheet2,Sheet2[A])

 

Then

 

Sum Average Measure by B = sumx( DISTINCT(Sheet2[B]), [Average Measure])

jthomson
Solution Sage
Solution Sage

Should be easy enough with an intermediate summary table, something like:

 

summarize(yourtablename,[column b],"column a averaged",average([column a])

 

You can then sum up your new "column a averaged" column

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