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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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