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
Jacodw0901
New Member

Weighted average calculation

Hi,

 

I would like to calculate the weighted average values on a matrix. This is a sample dataset:

 

UserIdCritIDCritSelValPoolCritIDPoolSelVal
130.2045.00
120.1457.00
120.2045.00
120.1437.00
110.2055.00
147.0050.14
110.1447.00
135.0050.20
115.0030.20
115.0020.20
145.0030.20
157.0020.14
145.0020.20
137.0020.14
155.0010.20
150.1447.00
147.0010.14
150.2035.00
130.2015.00
120.2015.00

 

This is the matrix view, using CritID and PoolCritID. Values in Matrix is the PoolSelVal

 
 
 12345
1 5.0005.0000.1430.200
20.200 0.1430.2000.143
30.2007.000 0.2005.000
47.0005.0005.000 7.000
55.0007.0000.2000.143 
Total12.40024.00010.3430.68612.343

I have a problem calculating the weighted average in the table below as the calculation in the row is not the same calculation in the total column

Normalised based on PoolCritID (Column) Column Total used to calculate the normalised value

Weighted average should be the average for each row excluding the 0

 

 12345Weighted Average
10.0000.2080.4830.2080.0160.23
20.0160.0000.0140.2920.0120.08
30.0160.2920.0000.2920.4050.25
40.5650.2080.4830.0000.5670.46
50.4030.2920.0190.2080.0000.23

 

Thanks

1 ACCEPTED SOLUTION
negi007
Community Champion
Community Champion

@Jacodw0901 

 

have you tried looking at the below solution

 

https://community.powerbi.com/t5/Desktop/Weighted-average-table-calculation/m-p/772223




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

You can use HASONEVALUE to get a different result in the total.

 

For example, I used this for one of my averages.  Because I wanted my total to be the total of all the averages, not an average of all the averages.

 

IF(HASONEVALUE(Items[Item]),AvgCost , SUMX(VALUES(Items[Item]),AvgCost))

 

negi007
Community Champion
Community Champion

@Jacodw0901 

 

have you tried looking at the below solution

 

https://community.powerbi.com/t5/Desktop/Weighted-average-table-calculation/m-p/772223




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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