Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi,
I would like to calculate the weighted average values on a matrix. This is a sample dataset:
| UserId | CritID | CritSelVal | PoolCritID | PoolSelVal |
| 1 | 3 | 0.20 | 4 | 5.00 |
| 1 | 2 | 0.14 | 5 | 7.00 |
| 1 | 2 | 0.20 | 4 | 5.00 |
| 1 | 2 | 0.14 | 3 | 7.00 |
| 1 | 1 | 0.20 | 5 | 5.00 |
| 1 | 4 | 7.00 | 5 | 0.14 |
| 1 | 1 | 0.14 | 4 | 7.00 |
| 1 | 3 | 5.00 | 5 | 0.20 |
| 1 | 1 | 5.00 | 3 | 0.20 |
| 1 | 1 | 5.00 | 2 | 0.20 |
| 1 | 4 | 5.00 | 3 | 0.20 |
| 1 | 5 | 7.00 | 2 | 0.14 |
| 1 | 4 | 5.00 | 2 | 0.20 |
| 1 | 3 | 7.00 | 2 | 0.14 |
| 1 | 5 | 5.00 | 1 | 0.20 |
| 1 | 5 | 0.14 | 4 | 7.00 |
| 1 | 4 | 7.00 | 1 | 0.14 |
| 1 | 5 | 0.20 | 3 | 5.00 |
| 1 | 3 | 0.20 | 1 | 5.00 |
| 1 | 2 | 0.20 | 1 | 5.00 |
This is the matrix view, using CritID and PoolCritID. Values in Matrix is the PoolSelVal
| 1 | 2 | 3 | 4 | 5 | |
| 1 | 5.000 | 5.000 | 0.143 | 0.200 | |
| 2 | 0.200 | 0.143 | 0.200 | 0.143 | |
| 3 | 0.200 | 7.000 | 0.200 | 5.000 | |
| 4 | 7.000 | 5.000 | 5.000 | 7.000 | |
| 5 | 5.000 | 7.000 | 0.200 | 0.143 | |
| Total | 12.400 | 24.000 | 10.343 | 0.686 | 12.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
| 1 | 2 | 3 | 4 | 5 | Weighted Average | |
| 1 | 0.000 | 0.208 | 0.483 | 0.208 | 0.016 | 0.23 |
| 2 | 0.016 | 0.000 | 0.014 | 0.292 | 0.012 | 0.08 |
| 3 | 0.016 | 0.292 | 0.000 | 0.292 | 0.405 | 0.25 |
| 4 | 0.565 | 0.208 | 0.483 | 0.000 | 0.567 | 0.46 |
| 5 | 0.403 | 0.292 | 0.019 | 0.208 | 0.000 | 0.23 |
Thanks
Solved! Go to Solution.
have you tried looking at the below solution
https://community.powerbi.com/t5/Desktop/Weighted-average-table-calculation/m-p/772223
Proud to be a Super User!
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))
have you tried looking at the below solution
https://community.powerbi.com/t5/Desktop/Weighted-average-table-calculation/m-p/772223
Proud to be a Super User!
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 43 | |
| 38 | |
| 35 | |
| 21 | |
| 15 |
| User | Count |
|---|---|
| 63 | |
| 58 | |
| 28 | |
| 27 | |
| 25 |