Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
I have a column of Gender, Male and Female. How can I create a measure to calculate the percentage of Female?
Thanks,
Solved! Go to Solution.
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))
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"
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))
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.
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"
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
79 | |
73 | |
58 | |
36 | |
32 |
User | Count |
---|---|
90 | |
62 | |
61 | |
49 | |
45 |