Add Column Count of people across two tables to get the count of people from a city

0 votes

I have two tables in Power Query City and People.

CITY

Id, Name
 1, Brisbane
 2, Sydney
 3, Melbourne

PEOPLE

Id, Name,  CityId
 1, Jay,   1
 2, Sam,   2
 3, Paul,  1
 4, Sarah, 3

I'd like to add a column to City that shows a count of how many people belong to that city.

Mar 14, 2019 in Power BI by Anitha
763 views

1 answer to this question.

0 votes
Hi Anitha,

1. Merge both tables, using City Id and Id into a new table.

2. Then create a column, count =  COUNTA(People[Name])

3. Add this measure, ID into visualization, to show each city and number of people in each.

Hope this helps you.
answered Mar 22, 2019 by Cherukuri
• 33,030 points

Related Questions In Power BI

+1 vote
1 answer

Need a DAX : To check the new escalations arrived, on the change of the escalation counter from zero to one or more

Yes exactly !  i need a measure for ...READ MORE

answered Sep 3, 2019 in Power BI by anonymous

edited Sep 3, 2019 1,203 views
0 votes
0 answers

How to count of category values in a column?

How to count of category values in ...READ MORE

Oct 30, 2019 in Power BI by ch
• 3,450 points
722 views
0 votes
1 answer

In DAX, how do I RETURN the sum of a calculated column from a DAX Table Variable (created via ADDCOLUMN)?

You can access column variables of previously ...READ MORE

answered Oct 8, 2020 in Power BI by Gitika
• 65,910 points
4,084 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
990 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,447 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,126 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,417 views
0 votes
1 answer

How to add slicer from a different tables?

Hi, Join is normally performed to get ...READ MORE

answered Mar 1, 2019 in Power BI by Cherukuri
• 33,030 points
4,058 views
0 votes
1 answer

Calculated column with the sum of values from many columns in a row

Hi, You can create a new column by ...READ MORE

answered Mar 14, 2019 in Power BI by Cherukuri
• 33,030 points
2,138 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