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
megm001
Advocate I
Advocate I

Defining a New Aggregate

Can I define a new aggregate?

 

For example, I'd like to weight my survey data, meaning I'd like to count each person's response as more or less than 1, depending on how accurately my sample represents the population. So, can I define a new aggregate, COUNTW, such that each person counts according to my weights column, w?

3 REPLIES 3
v-ljerr-msft
Employee
Employee

Hi @megm001,

 

Have you tried the suggestion provided by @Phil_Seamark above? Does it work in your scenario?

 

If you still have any question on this issue, feel free to post here? Smiley Happy

 

Regards

Phil_Seamark
Employee
Employee

Hi @megm001

 

Why not create a new calculated column that contains a formula that determines the value and then simply SUM that.


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Thank you, @Phil_Seamark

Yes, that would work if I only wanted to count the number of responses for a given question (ie: count of respodents as the value). But what about something more complex, such as viewing spending across income levels by age group (ie: Line Chart where axis is income, legend is age group, values is spending)? In this case, how can I weigh the average spending? Manually, it would be sum of each respondent's spending multiplied by their corresponding weight, divided by the sum of the respondent's weights. (Σ(r_i(spending)*r_i(weight))/Σ(r_i(weight)), where r_i is each relevant respondent).

In general, is there any way I can apply weights to all my data?

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.