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
Rewind
Helper I
Helper I

Equivalent of =SUMPRODUCT?

Looking for an PBI equivilant of sum product to work out weighted mean. Been stuck trouble shooting solutions and now I just think I'm overthinking this...

 

IdentifierScoresWeight
10.674%
20.674%
30.6319%
40.624%
50.5920%
60.334%
70.148%
80.1111%
905%
1002%

 

Weighted Average (value im looking for) = 0.46

Average = 0.37

 

Bonus if it can be dynamic (e.g. user filters for identifier 1,2,3 and caculates weight and then weighted mean)

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @Rewind 

A measure like this should do the trick, assuming the weighting is to be done row-by-row over your table:

Weighted Average = 
VAR WeightedSum =
    SUMX ( 
        YourTable,
        YourTable[Scores] * YourTable[Weight]
    )
VAR TotalWeight = 
    SUM ( YourTable[Weight] )
RETURN
    DIVIDE ( WeightedSum, TotalWeight )

The measure iterates over your table, summing Scores * Weight, then divides by the total Weight.

This will also be dynamic in that it will respond to any filters you apply.

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

View solution in original post

2 REPLIES 2
OwenAuger
Super User
Super User

Hi @Rewind 

A measure like this should do the trick, assuming the weighting is to be done row-by-row over your table:

Weighted Average = 
VAR WeightedSum =
    SUMX ( 
        YourTable,
        YourTable[Scores] * YourTable[Weight]
    )
VAR TotalWeight = 
    SUM ( YourTable[Weight] )
RETURN
    DIVIDE ( WeightedSum, TotalWeight )

The measure iterates over your table, summing Scores * Weight, then divides by the total Weight.

This will also be dynamic in that it will respond to any filters you apply.

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

Thanks Owen, this solved my problem. Should have come here a few hours ago  😅

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.