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.
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
Solved! Go to Solution.
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)
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)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |