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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.