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!View all the Fabric Data Days sessions on demand. View schedule
Unit | Category | Score | Weight |
| Unit A | X | 5 | 2 |
| Unit A | Y | 10 | 3 |
Unit A | Z | 15 | 2 |
Unit B | X | 1 | 7 |
Unit B | Z | 2 | 9 |
Unit C | W | 4 | 11 |
Essentially, what I want to do is, within each unit, add up the product of the scores and their corresponding weights, and divide by the sum of the weights within each unit. These should be displayed in a table. The output table should look like
| Unit | Calculated Column |
Unit A | 10 |
| Unit B | 1.5625 |
| Unit C | 4 |
I have been fighting with this for hours and am pretty frustrated.
Calculation = GROUPBY('Proper Business Unit Rollup Step 2 Table'[Unit],
Solved! Go to Solution.
@Anonymous try this
Measure =
VAR _sum =
SUMX ( tbl, tbl[score] * tbl[weight] )
VAR _count =
CALCULATE ( SUM ( tbl[weight] ), ALLEXCEPT ( tbl, tbl[unit] ) )
RETURN
DIVIDE ( _sum, _count )
Hi @Anonymous
You may try this Calculated Column.
Calculated Column =
DIVIDE (
'Table'[Score] * 'Table'[Weight],
CALCULATE ( SUM ( 'Table'[Weight] ), ALLEXCEPT ( 'Table', 'Table'[Unit] ) )
)
The result should look like this:
For more details, please refer to the attached pbix file.
Best Regards,
Community Support Team _ Caiyun
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. If you still have problems on it or I misunderstand your needs, please feel free to let us know. Thanks a lot!
Hi,
if you want to use groupby function, please try the below. (attached file).
It is for creating a new table.
New table =
VAR newtable =
GROUPBY (
Data,
Data[Unit],
"@scoreweight", SUMX ( CURRENTGROUP (), Data[Score] * Data[Weight] ),
"@weightsum", SUMX ( CURRENTGROUP (), Data[Weight] )
)
RETURN
GROUPBY (
newtable,
Data[Unit],
"@calculatedColumn", SUMX ( CURRENTGROUP (), [@scoreweight] / [@weightsum] )
)
@Anonymous try this
Measure =
VAR _sum =
SUMX ( tbl, tbl[score] * tbl[weight] )
VAR _count =
CALCULATE ( SUM ( tbl[weight] ), ALLEXCEPT ( tbl, tbl[unit] ) )
RETURN
DIVIDE ( _sum, _count )
@Anonymous Did you have a chance to look into this?
NewTable=ADDCOLUMNS(VALUES('Table'[Unit]),"@CalCol",CALCULATE(DIVIDE(SUMX('Table','Table'[Score]*'Table'[Weight]),SUM('Table'[Weight]))))
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 13 | |
| 9 | |
| 9 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 28 | |
| 20 | |
| 20 | |
| 19 | |
| 12 |