cancel
Showing results for
Did you mean:

## 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):

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
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)

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)

Announcements