Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
achristopherson
Frequent Visitor

How to show total number of people from various zip codes?

Hello, I have an issue and I am wondering if someone can help. I have an applicant table that has name, address, zip, applicanti id, etc. But I need to show how many applicants are coming from each zip code. How can I do this? It seems like it should be an easy thing to do but I can't seem to figure it out. In simple terms I need to know: count of applicants by zip code. 

1 ACCEPTED SOLUTION
vega
Resolver III
Resolver III

You can put zip code into the rows and then names in the values column. From there select the arrow on the names tag and select count. Please see below:

 

Capture.PNGCapture1.PNG

View solution in original post

6 REPLIES 6
edhans
Community Champion
Community Champion

Take a look at this file. 

 

Basically you just need to use the COUNT() measure.

 

Name Count = COUNT('Names by Zip Code'[Names])

When you drop the zip codes and Name Count measure into a table, it will automatically give you the total per zip code.

 

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

I can't get this to work. The table is called 'Applicant' and the fields are ApplicantID and ZIP. I keep getting a syntax error..

 

This is what I tried: Name Count = COUNT('Applicant'[ApplicantID] by 'Applicant'[zip])  and it doesn't work. 


@achristopherson wrote:

I can't get this to work. The table is called 'Applicant' and the fields are ApplicantID and ZIP. I keep getting a syntax error..

 

This is what I tried: Name Count = COUNT('Applicant'[ApplicantID] by 'Applicant'[zip])  and it doesn't work. 


FWIW, COUNT() only takes one argument, a column. The "By zip" would be taken care of in the filter context of the table. When you drop the COUNT() measure in the table next to the zip codes, the DAX engine goes down each row in the table and says "Ok, I need to count the names, but only for the row I am on, which is zip 12345" then it moves to the next row and does the same.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

It would need to be done this way:

 

CountMeasure = COUNT('Applicant'[ApplicantID])

Then, you place the zips as row value and this new measure as the values. It is the same as doing it through the UI. 

vega
Resolver III
Resolver III

You can put zip code into the rows and then names in the values column. From there select the arrow on the names tag and select count. Please see below:

 

Capture.PNGCapture1.PNG

This is exactly what I needed. Thank You. I used Applicant ID instead of name but otherwise I did exactly as you said. 

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.