cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Syndicate_Admin
Administrator
Administrator

WEIGHTED AVERAGE IN THE TOTAL

Good morning!

I have a problem getting the weighted average in the total. Example:

We have 2 marketing campaigns, one that impacts men and the other women. For each campaign we have an action group (GA) and a control group (GC) to measure the impact of the campaign.

For each campaign we calculate the average sale of the GA and the average sale of the GC to obtain the GAP (difference between GA and GC):

robert_sola_2-1665135355642.png

The fact is that the total value of the GAP column (804.62) is not correct, since it is obtained by making the difference of the total means (1,120 - 315.38 = 804.62) and that value is not weighted by the weight of the field CLIENTES_GA.

In the total GAP I would like to obtain the gap weighted by campaign based on the number of CLIENTES_GA, that is, the multiplication of (1,340*100 + 441.67*150) / 250 = 801. As the GA and the GC have different weights in each campaign it is not correct to calculate the GAP as the difference in totals, it must be weighted.

In short, calculating the GAP per row would be fine, but when adding the two campaigns, the total would have to calculate the weighting based on the number of customers in each campaign.

Any idea how I can get that weighted Gap?

Thanks a lot!!!

Best regards

Robert

1 ACCEPTED SOLUTION
HoangHugo
Solution Specialist
Solution Specialist

Hi, try this one

 

GAP 2 =
var campaign =SELECTED([campaign column])

var client = SUM([client])
return if (campaign = BLANK(),GAP measure, SUMX(SUMMARIZE([campaign column]),GAP x client)/client)

View solution in original post

1 REPLY 1
HoangHugo
Solution Specialist
Solution Specialist

Hi, try this one

 

GAP 2 =
var campaign =SELECTED([campaign column])

var client = SUM([client])
return if (campaign = BLANK(),GAP measure, SUMX(SUMMARIZE([campaign column]),GAP x client)/client)

Helpful resources

Announcements
November 2022 Update

Check it Out!

Click here to read more about the November 2022 updates!

Microsoft 365 Conference â__ December 6-8, 2022

Microsoft 365 Conference - 06-08 December

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power BI Dev Camp Session 27

Ted's Dev Camp

This session walks through creating a new Azure AD B2C tenant and configuring it with user flows and custom policies.