Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
80 | |
76 | |
60 | |
36 | |
33 |
User | Count |
---|---|
91 | |
60 | |
59 | |
49 | |
45 |