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 in Power BI by Anitha
14 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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 by CHERUKURI
• 15,620 points

Related Questions In Power BI

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 in Power BI by Upasana
• 8,210 points
59 views
0 votes
1 answer

How to create final table based on Joins of two tables in power BI?

Hi Nithin, It is easy and simple. 1. Go ...READ MORE

answered Mar 1 in Power BI by CHERUKURI
• 15,620 points
69 views
0 votes
1 answer

How can I get a column value from previous row in Power Query?

Hi Sindhu, add this line as your ...READ MORE

answered Mar 18 in Power BI by CHERUKURI
• 15,620 points
66 views
0 votes
1 answer

How to add multiple reference lines on a bar/ column graph?

Hi, Follow below steps: 1. Add a bar/ column ...READ MORE

answered Mar 26 in Power BI by CHERUKURI
• 15,620 points
36 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,060 points
53 views
0 votes
1 answer

Unable to install connector for Power Bi and PostgreSQL

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

answered Aug 21, 2018 in Power BI by nirvana
• 3,060 points
411 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
• 14,080 points
71 views
0 votes
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
• 36,420 points
65 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 in Power BI by CHERUKURI
• 15,620 points
99 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 in Power BI by CHERUKURI
• 15,620 points
14 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.