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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Match and Count

Hello, I searched for this in the forums, but I think I'm using the wrong terms and it's not a "match and count".  

I'd like to take the "Employee ID" data and count how many times it appears in the "Mgr_EmplID" column and return a total to a new column. In the example below "111" shows up twice under MGR_EMPLID, so the new column entry would show a "2".  I'm sure this has been answered before on the forums, but I can't find it, can someone point me in the right direction? Thank you!

 

EMPLOYEE IDMGR_EMPLID
111122
155111
122104
124111

 

1 ACCEPTED SOLUTION
lkalawski
Super User
Super User

Hi @Anonymous ,

You can use this measure:

CountOfEmployeeId = 
CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'), 'Table'[MGR_EMPLID] = SELECTEDVALUE('Table'[EMPLOYEE ID])))

lkalawski_0-1612214730631.png

 

PBI_SuperUser_Rank@1x.png Proud to be a Super User.
If I helped, please accept the solution and give kudos
Linkedin

 

View solution in original post

3 REPLIES 3
smpa01
Super User
Super User

@Anonymous  try this

Column = CALCULATE(COUNTX('Table 1','Table 1'[MGR_EMPLID]),ALLEXCEPT('Table 1','Table 1'[MGR_EMPLID]))

Capture.PNG

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
Anonymous
Not applicable

Perfect, thank you very much! 

lkalawski
Super User
Super User

Hi @Anonymous ,

You can use this measure:

CountOfEmployeeId = 
CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'), 'Table'[MGR_EMPLID] = SELECTEDVALUE('Table'[EMPLOYEE ID])))

lkalawski_0-1612214730631.png

 

PBI_SuperUser_Rank@1x.png Proud to be a Super User.
If I helped, please accept the solution and give kudos
Linkedin

 

Helpful resources

Announcements
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.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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