Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join 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.

Reply
Syndicate_Admin
Administrator
Administrator

Create a chart with an average DAX measurement

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:

data_operador1_1-1641829923492.png

The other measures created are also sums:

data_operador1_2-1641829988143.png

data_operador1_3-1641830012909.png

And the variable inside a meter looks like this:

data_operador1_0-1641829886601.png

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:

data_operador1_4-1641830691480.png

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

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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.

yingyinr_0-1642059924878.png

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

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

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

Anonymous
Not applicable

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.

yingyinr_0-1642059924878.png

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

amitchandak
Super User
Super User

@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

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.