cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nnn123 Frequent Visitor
Frequent 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

Accepted Solutions
jthomson New Contributor
New Contributor

Re: Aggregating stratified data

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

View solution in original post

1 REPLY 1
jthomson New Contributor
New Contributor

Re: Aggregating stratified data

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

View solution in original post

Helpful resources

Announcements
Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 109 members 1,331 guests
Please welcome our newest community members: