Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi team,
I have a dataset like this
| Category | Sub Category | Weight | Value |
| A | A1 | 0,2 | 5 |
| A | A2 | 0,1 | 3 |
| B | B1 | 0,3 | 2 |
| B | B2 | 0,1 | 4 |
| B | B3 | 0,3 | 5 |
and i want to create a matrix with categories & sub categories and with the weighted average while keeping the value at the row level as seen in the "desired output" column
| Category | Sub Category | Weight | Value | Weight x Value | Desired output |
| A | 4,33 | ||||
| A1 | 0,2 | 5 | 1 | 5 | |
| A2 | 0,1 | 3 | 0,3 | 3 | |
| B | 3,57 | ||||
| B1 | 0,3 | 2 | 0,6 | 2 | |
| B2 | 0,1 | 4 | 0,4 | 4 | |
| B3 | 0,3 | 5 | 1,5 | 5 | |
| TOTAL | 3,8 |
with 4.33 = (3*0.1+5*0.2)/(0.1+0.2)
many thanks
Solved! Go to Solution.
Hi, @BMltc
Please check the below picture and the sample pbix file's link down below.
Desired Output measure =
IF (
ISINSCOPE ( 'Table'[Sub Category] ),
SUMX ( 'Table', 'Table'[Value] ),
CALCULATE (
SUMX ( 'Table', 'Table'[Weight] * 'Table'[Value] ),
ALLEXCEPT ( 'Table', 'Table'[Category] )
)
/ CALCULATE (
SUMX ( 'Table', 'Table'[Weight] ),
ALLEXCEPT ( 'Table', 'Table'[Category] )
)
)
https://www.dropbox.com/s/o2flu2oirbhk9d7/bmltc.pbix?dl=0
Hi, @BMltc
Please check the below picture and the sample pbix file's link down below.
Desired Output measure =
IF (
ISINSCOPE ( 'Table'[Sub Category] ),
SUMX ( 'Table', 'Table'[Value] ),
CALCULATE (
SUMX ( 'Table', 'Table'[Weight] * 'Table'[Value] ),
ALLEXCEPT ( 'Table', 'Table'[Category] )
)
/ CALCULATE (
SUMX ( 'Table', 'Table'[Weight] ),
ALLEXCEPT ( 'Table', 'Table'[Category] )
)
)
https://www.dropbox.com/s/o2flu2oirbhk9d7/bmltc.pbix?dl=0
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |