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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Nightfalcon17
New Member

Need to count the number of times a name appears in a column based on a separate list of names.

I am working with a dataset that has various tasks that need to be completed on a single invoice. I need to create a pivot table that counts the number of times each employee's name shows under each task. However the data set has names of people (i.e. Erin) that I don't need to include in the pivot table. The only names I need in the pivot table are shown under the "employee" table (a.k.a. Table 2). I'm trying to make this sheet easy to work with so as new employees come along we can simply add their name to the "employee list"  and it will add them into the pivot table. 

 

I have tried countrows, counta, and other various measures in my data model but have not been able to get it to work yet. With not being able to create relationships between the two tables it is makeing it difficult to filter how I need it to show.  The closest I can get only takes one column's data into account and the will then duplicate that into the next columns reguardless of the field I select to be in the next column. 

 

Here is a screenshot of a sample data sheet I put together to illustrate the problems I am having.  I have also created a manual caluclation at the bottom to illistrate how I would like the data to show.  

 

Nightfalcon17_0-1682367648195.png

 

1 ACCEPTED SOLUTION
Ajendra
Resolver I
Resolver I

Hey pls check below:-

 

Select last three columns and "Unpivot" them only in Power-Query (Select them at the same time and Use Right Click).

1.JPG

 

Then Insert a Matrix Table and place field into that as shown below.

2.JPG

 

 

At the last try to create this measure and place that measure into the Matrix table.

3.JPG

 

I hope i got your question correctly and answered. Thanks!!

View solution in original post

2 REPLIES 2
Nightfalcon17
New Member

I completly forgot about unpivot option. That got me what I needed. Thank you so much for your help!

Ajendra
Resolver I
Resolver I

Hey pls check below:-

 

Select last three columns and "Unpivot" them only in Power-Query (Select them at the same time and Use Right Click).

1.JPG

 

Then Insert a Matrix Table and place field into that as shown below.

2.JPG

 

 

At the last try to create this measure and place that measure into the Matrix table.

3.JPG

 

I hope i got your question correctly and answered. Thanks!!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.