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
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
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

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.