To get the results you are looking for, follow these steps:
-
Make a second table using the New Table button with the following code:
GenderCounts = DISTINCT(TableName[Gender])
-
Make a relationship from the newly create table back to the original table
-
Add a new column to the GenderCounts table with the following code:
Count = COUNTROWS(RELATEDTABLE(TableName))
And there you have a second table containing the counts of each gender.
For more information and other possibilities, check out a related Power BI Community forum post here and Stackoverflow questions here and here.
solved Calculate Total male Total Female in powerbi report