Calculate Total number of Male Female in the PowerBI report

0 votes

I want to count the total number of males and females in a PowerBI report such that, if my report table looks like the one given below:

Name    Gender
std1    Female
std2    Male
std3    Female
std4    Male
std5    Male
std6    Male

The result I should be:

Female 2
Male   4
Feb 28, 2019 in Power BI by Shubham
• 13,490 points
10,285 views

1 answer to this question.

0 votes

To achieve what you are looking for, you could do the folllowing;

  1. Make a new table using the New Table button with the following code:

    GenderCounts = DISTINCT(TableName[Gender])
    
  2. Make a relationship from the new table with the original table 

  3. Add a new column to the GenderCounts table with the following code:

    Count = COUNTROWS(RELATEDTABLE(TableName))
    
  4. And there you have another table containing the count for each gender. 

Preparing for the Power BI exam? Check out Power BI Syllabus now!

answered Feb 28, 2019 by Upasana
• 8,620 points

Related Questions In Power BI

0 votes
1 answer
0 votes
1 answer

How to Toggle Between Two Option and Make it Interact with the rest of the Visualizations in a Report?

Toggling is an action that is achieved ...READ MORE

answered Oct 20, 2020 in Power BI by anonymous
• 65,910 points
921 views
+1 vote
1 answer

Show the latest value in PowerBi from ASA

Best you can do right now is ...READ MORE

answered Oct 25, 2018 in Power BI by Surendra
1,410 views
0 votes
1 answer

Displaying Table Schema using Power BI with Azure IoT Hub

Answering your first question, Event Hubs are ...READ MORE

answered Aug 1, 2018 in IoT (Internet of Things) by nirvana
• 3,130 points
1,017 views
+1 vote
1 answer

Unable to install connector for Power Bi and PostgreSQL

I think the problem is not at ...READ MORE

answered Aug 22, 2018 in Power BI by nirvana
• 3,130 points
2,479 views
+2 votes
2 answers

Migrate power bi collection to power bi embedded

I agree with Kalgi, this method is ...READ MORE

answered Oct 11, 2018 in Power BI by Hannah
• 18,570 points
1,152 views
+1 vote
1 answer

Connect power bi desktop to dataset and create custom reports

Yes using Power BI REST API to ...READ MORE

answered Sep 18, 2018 in Power BI by Kalgi
• 52,360 points
1,440 views
0 votes
1 answer

To Calculate the Standard Deviation in Power BI

Suppose you've to obtain the Standard Deviation ...READ MORE

answered Nov 26, 2018 in Power BI by Upasana
• 8,620 points
15,091 views
0 votes
1 answer

To expand all lists in a row of lists at the same time without recurring values

Can't promise simple, but I have something ...READ MORE

answered Feb 19, 2019 in Power BI by Upasana
• 8,620 points
5,707 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP