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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.