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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Count Number of Team Members Per Manager

Hi Everyone,

I'm trying to create a measure that will count the number of team members under each manager. I already have a many to one relationship between the employees data and the manager names' table.

 

Please help! It seems simple but I can't figure out what's wrong with my model.

 

This is the measure I have:

 

NumofTeamMembers= CALCULATE(COUNTA('Employee'[Name]),'Employee' [ManagerName]='Managers'[ManagerName])

 

The error message is the following: The expression contains multiple columns, but only a single column can be used in a True/False expression that is used as a table filter expression.

 

Screenshot 2020-12-18 160549.jpg

 

Any help is really appreciated, thank you!!

1 ACCEPTED SOLUTION
AllisonKennedy
Super User
Super User

@Anonymous  Try just a simple measure: 

 

NumofTeamMembers= COUNTA('Employee'[Name])

 

Then put this in a visual in Values with Manager table, Manager column in the columns/rows/axis field (depending on what visual you select).

 

Also, please set the cross filter direction of your relationship to single if you don't need it to both. https://excelwithallison.blogspot.com/2020/08/its-complicated-relationships-in-power_92.html

 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

5 REPLIES 5
AllisonKennedy
Super User
Super User

@Anonymous  You're welcome. 🙂 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Anonymous
Not applicable

Thank you, the function works!!

AllisonKennedy
Super User
Super User

@Anonymous  Try just a simple measure: 

 

NumofTeamMembers= COUNTA('Employee'[Name])

 

Then put this in a visual in Values with Manager table, Manager column in the columns/rows/axis field (depending on what visual you select).

 

Also, please set the cross filter direction of your relationship to single if you don't need it to both. https://excelwithallison.blogspot.com/2020/08/its-complicated-relationships-in-power_92.html

 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

amitchandak
Super User
Super User

@Anonymous , I do not see need ot this join

 

NumofTeamMembers= CALCULATE(COUNTA('Employee'[Name]))

 

if needed it will work like

 

NumofTeamMembers= CALCULATE(COUNTA('Employee'[Name]),filter('Employee', 'Employee' [ManagerName]=max('Managers'[ManagerName])))

 

 

if you need Avg

averagex(Values('Managers'[ManagerName]) , CALCULATE(COUNTA('Employee'[Name])))

Anonymous
Not applicable

Thank you, it works!!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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