cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
huguest Member
Member

Re: Average based on distinct values in another column

Hello, older thread but taking a chance here...  I have a very similar scenario, except that I need to include a additional parameter to the equation.  To continue with the OP's example, I would also have another column for the employee gender, and need a formula that will calculate the average age of Male employees.  How can this be done?

Thanks.

Highlighted
bullius Member
Member

Re: Average based on distinct values in another column

Try adding in a FILTER clause, e.g.

 

AVERAGEX (
    SUMMARIZE (
        FILTER (
            Table1,
            Table1[Gender] = "Male"
        ),
        Table1[Employee], 
        Table1[Age]
    ), 
    Table1[Age]
)

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 308 members 2,833 guests
Please welcome our newest community members: