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
Anonymous
Not applicable

Getting Average of Measure

On one of my line charts, I have measures which contain percentages for all females for a number of groups.

 

When I put the measure on a line graph, it shows the sum of all percentages = 500%, however I want to get the average = 92%. I can do this with normal column variables, but it doesn't allow me to do it with measure.

 

Do you know how I can do this with measures?

10 REPLIES 10
rajulshah
Resident Rockstar
Resident Rockstar

Hello @Anonymous,

 

You can use the following DAX:

Average Value = AVERAGEX(SUMMARIZE(Table,Table[Group],"AverageV",[Average Measure]),[AverageV])


Please let me know if this didn't help and provide more details so that I can help you with accurate DAX function. 

Anonymous
Not applicable

@rajulshah  Thanks for replying. How would I apply that DAX function to my current measure? This is the code for it:
 
MALE PRESENT NATIONAL =
CALCULATE(
[Present Percent National],
'All Years Characteristics'[Characteristics] = "MALE"
)
 

@Anonymous,

So, what I understand is you want to average the value among female and male, right?

Anonymous
Not applicable

@rajulshah  Yes, but I have the male and female in measures. When I put them on the line chart, I can't select average. I could only do that if they were columns, but in this case they have to be measures

So, you can try creating 2 measures for Male and Female.

Male Average =
AVERAGEX (
    FILTER (
        SUMMARIZE (
            'All Years Characteristics',
            'All Years Characteristics'[Characteristics],
            "AverageV", [Present Percent National]
        ),
        'All Years Characteristics'[Characteristics] = "MALE"
    ),
    [AverageV]
)
Female Average =
AVERAGEX (
    FILTER (
        SUMMARIZE (
            'All Years Characteristics',
            'All Years Characteristics'[Characteristics],
            "AverageV", [Present Percent National]
        ),
        'All Years Characteristics'[Characteristics] = "FEMALE"
    ),
    [AverageV]
)

 

Hope this helps.

Anonymous
Not applicable

Thanks rajulshah

But that didn't return the average, it produced the same result as I had before

@Anonymous, can you please provide sample data and snapshot of what is showed in the table?

Anonymous
Not applicable

rajulshah If I made a calculated column, it would have this code:

 

MALE PRESENT NATIONAL =
CALCULATE(
[Present Percent National],
'All Years Characteristics'[Characteristics] = "MALE"
)
 
And then I would select Average on the line chart instead of Sum. However, it needs to be a measure, so I used the same code but it wont let me select average.

@Anonymous,

 

I guess I could help efficiently if there maybe any sample data available.

amitchandak
Super User
Super User

I doubt the measure calculation has some issues.

Also, refer

https://geekdecoders.blogspot.com/2019/02/how-to-insert-average-line-in-power-bi.html

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/Winner-Topper-on-Map-How-to-Color-States-on-a-Map-wi...
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

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.