cancel
Showing results for
Did you mean:
Highlighted
Frequent Visitor

## How to do an average of text column with a whole number column?

I am new to Power BI and have this problem I cannot solve. I have a two columns one with the Gender (Male/Female) and the other column with the Age. My question is how can i make a measure of the average age of Male and Female?

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User

## Re: How to do an average of text column with a whole number column?

Assuming you've made a measure that works out the average of your column, you just need to apply a filter, something like:

calculate([youraverageagemeasure],genderfield="Male")

should work for you

Super User

## Re: How to do an average of text column with a whole number column?

Not entirely sure how averagex works, and it seems unnecessary compared to plain old average in this case - just make a measure AverageAge = AVERAGE(youragecolumn), then if it works for everything combined, then feed that into other measures as described above

3 REPLIES 3
Super User

## Re: How to do an average of text column with a whole number column?

Assuming you've made a measure that works out the average of your column, you just need to apply a filter, something like:

calculate([youraverageagemeasure],genderfield="Male")

should work for you

Frequent Visitor

## Re: How to do an average of text column with a whole number column?

I have write it like this but it doesn't work:

Average Male = CALCULATE(AVERAGEX('Statistic'; ' Statistic[Gender]="Male"); ' Statistic'[Age]))

Super User

## Re: How to do an average of text column with a whole number column?

Not entirely sure how averagex works, and it seems unnecessary compared to plain old average in this case - just make a measure AverageAge = AVERAGE(youragecolumn), then if it works for everything combined, then feed that into other measures as described above