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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.