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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.