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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
vincetaylor
Helper I
Helper I

Dynamically Count the number of occurrences of each item

I have a table with names that are added periodically. I would like to count the number of times each name appears in the column and display the information in a table. Each time a name is added, that name should also be added to the table. I would appreciate ideas.

 

This is what the column looks like and next is what the resulting table should look like

 

ColumnColumnTable DisplayTable Display

2 ACCEPTED SOLUTIONS
PhilipTreacy
Super User
Super User

Hi @vincetaylor 

 

Download sample PBIX file

 

Use this measure

 

Measure = CALCULATE(COUNTROWS('Names'), FILTER('Names', 'Names'[Name] = SELECTEDVALUE('Names'[Name])))

 

namecount.png

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

Drag the name column to a Table visual and write this measure

Count = countrows(Data)

Data is the name of the Table.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Drag the name column to a Table visual and write this measure

Count = countrows(Data)

Data is the name of the Table.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
PhilipTreacy
Super User
Super User

Hi @vincetaylor 

 

Download sample PBIX file

 

Use this measure

 

Measure = CALCULATE(COUNTROWS('Names'), FILTER('Names', 'Names'[Name] = SELECTEDVALUE('Names'[Name])))

 

namecount.png

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!