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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
nnn123
Regular Visitor

Aggregating stratified data

Hi,

 

I'm trying to aggregate some survey results in Power BI. The survey respondents were all split into 4 categories/strata and then a weight applied to the separate stratum before calculating weighted results, as in table below (Weighted Result = Result * Weight)

CouncilResultStratumWeightWeighted Result
110110.5105
140212480
160315.2912
12049.5190
21518120
220210.8216
250311550
260413.5810
330113390
330210.5315
350312600
360415.2912

 

I don't want to display the results at strata level in Power BI report though so I would like to be able to calculate the weighted results by strata and then display council level aggregated results only like this:

CouncilWeighted Result
11687
21696
32217

 

In this table above all the 4 separate strata results have been aggregated together for each council. When I try this in a Power BI 'Table' visualisation though it just sums everything (including adding all the weight column together) which is not what i want - the 4 separate weighted results must be calculated individually first in order to produce correct results. Is it possible to produce this simple 2-column table above in a Power BI report?

 

1 ACCEPTED SOLUTION
jthomson
Solution Sage
Solution Sage

Make a measure WeightedResult = Calculate(sumx(tablename,tablename[Result]*tablename[weight]))

View solution in original post

1 REPLY 1
jthomson
Solution Sage
Solution Sage

Make a measure WeightedResult = Calculate(sumx(tablename,tablename[Result]*tablename[weight]))

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

Check out the April 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors