Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello
I'm trying to make a graph of a variable called CPA (Cost Per Acquisition) that shows what it costs a company to sell a product. To display this variable is calculated as follows:
The other measures created are also sums:
And the variable inside a meter looks like this:
I have the problem when I try to show the evolution of that CPA (that measure) over several months. The graph divides the total CPA that I have obtained in the 12 months and gives results whose sum is 87.84 (the problem is that the values of each month should obtain an average of 87.84). Here is the example:
Obviously I have done something wrong, but I do not know how to make the formula in DAX so that it gives good.
Thank you so much.
Greetings
Solved! Go to Solution.
Hi @data_operador1 ,
Did you mean that the column chart's data displayed incorrectly, it should show 87.84 for each month? How is your column chart visual set (Axis: Month Values: [CPA TOTAL])? Please provide the relevant calculation logic and a specific example to illustrate the correct result. Thank you.
And you can change the formula of your measure [CPA TOTAL] to look like this and check later if you can get the correct result...
CPA TOTAL =
DIVIDE (
SUM ( Inversion_Digital_Particion[Coste] ) + Inversion_Digital_Particion[Externa_Coste_Hora_Agente],
SUMX (
ALLSELECTED ( Inversion_Digital_Particion ),
Inversion_Digital_Particion[Externa_Numero_Asegurados]
),
0
)
Best Regards
Hi @data_operador1 ,
Whether your problem has been resolved? If yes, could you please mark your post as Answered? It will help the others in the community find the solution easily if they face the same problem with you. Thank you.
Best Regards
Hi @data_operador1 ,
Did you mean that the column chart's data displayed incorrectly, it should show 87.84 for each month? How is your column chart visual set (Axis: Month Values: [CPA TOTAL])? Please provide the relevant calculation logic and a specific example to illustrate the correct result. Thank you.
And you can change the formula of your measure [CPA TOTAL] to look like this and check later if you can get the correct result...
CPA TOTAL =
DIVIDE (
SUM ( Inversion_Digital_Particion[Coste] ) + Inversion_Digital_Particion[Externa_Coste_Hora_Agente],
SUMX (
ALLSELECTED ( Inversion_Digital_Particion ),
Inversion_Digital_Particion[Externa_Numero_Asegurados]
),
0
)
Best Regards
@Syndicate_Admin ,based on what I got
if you want the overall value in bar visual , the use allselected or all in visual
example
calculate(divide([A], [B]), allselected(Table)) //Where A and b are measures
or
calculate(divide([A], [B]), all(Table)) //Where A and b are measures
User | Count |
---|---|
76 | |
75 | |
46 | |
31 | |
27 |
User | Count |
---|---|
99 | |
89 | |
52 | |
48 | |
46 |