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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
midorobaka
New Member

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
jthomson
Solution Sage
Solution Sage

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

View solution in original post

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

View solution in original post

3 REPLIES 3
jthomson
Solution Sage
Solution Sage

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

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

 

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

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors