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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
abukapsoun
Post Patron
Post Patron

Calculate Percentage of Gender

Hi,

 

I have a column of Gender, Male and Female. How can I create a measure to calculate the percentage of Female?

 

Thanks,

2 ACCEPTED SOLUTIONS
erik_tarnvik
Solution Specialist
Solution Specialist

It depends. If you simply want a percentage in a visual, you can create a measure 

Percentage = Countrows(YourTable)/Countrows(ALL(YourTable))

Create a visual with YourTable[Gender] in the first column and Percentage in the second (and format the number produced by Percentage appropriately) you will see the percentage of both Female and Male. In fact, you would see the percentage distribution of anything you put in that visual, not only gender...

 

If you truly want a measure that always give you the percentage of females in your table regardless of context:

PercentageFemale = COUNTROWS(FILTER(ALL(YourTable),YourTable[Gender] = "Female"))/COUNTROWS(ALL(YourTable))

View solution in original post

No, a table visualization, or you could use another visualization, whatever visualization you want really. In the Values area for your COUNT, click the down arrow and choose "Show value as" and then "Percent of grand total"



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
erik_tarnvik
Solution Specialist
Solution Specialist

It depends. If you simply want a percentage in a visual, you can create a measure 

Percentage = Countrows(YourTable)/Countrows(ALL(YourTable))

Create a visual with YourTable[Gender] in the first column and Percentage in the second (and format the number produced by Percentage appropriately) you will see the percentage of both Female and Male. In fact, you would see the percentage distribution of anything you put in that visual, not only gender...

 

If you truly want a measure that always give you the percentage of females in your table regardless of context:

PercentageFemale = COUNTROWS(FILTER(ALL(YourTable),YourTable[Gender] = "Female"))/COUNTROWS(ALL(YourTable))

Greg_Deckler
Community Champion
Community Champion

Create a table with Gender column and a COUNT column and then use a Quick Measure for Percent of Grand Total and it will give you the formula.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

I dont really want to create a new table for certain purpose. Can't I just calculate it from the data in the Gender column without having the need to create a new table?

 

thanks,

No, a table visualization, or you could use another visualization, whatever visualization you want really. In the Values area for your COUNT, click the down arrow and choose "Show value as" and then "Percent of grand total"



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.