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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Higgs11
Frequent Visitor

counting number of employees by hours worked

I have a table that has employee hours by employee ID and Project. In the table the employee id will show up on multiple rows if they work on more than one project. I have a Dax to count the number of employees.

Total Headcount = DISTINCTCOUNT('Employee'[User ID])
I have a DAX for Total Hours
Total Hours = SUM('Employee'[Total Hours])
I have another measure for [Capacity Hours] which is the total hours in the month, for this example it will be 160.
I want to count the number of employees in buckets, for example:
A-Count the # of employees who worked less than 75% of the capacity hours  <= 0.75 *[Capacity Hours]
B-Count the # of employees who worked between 76% and 100% of capacity hours   >=0.75 * [Capacity Hours]
C-Count the # of employees who worked more than 100% of capacity hours  > [Capacity Hours]
 
The result will give me three rows in a table
Full/Part TimeTotal Headcount
A5
B9
C8

 

Example of 'Employee' table

User IDProjectTotal Hours
a1aa100
a1bb60
b1aa40
c1bb160
c1cc10
d1aa80
d1cc20

 

Thank you

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Hi, @Higgs11 

I am not sure if I understood your question correctly, but please check the below picture and the sample pbix file's link down below.

 

All measures are in the sample pbix file.

 

Picture1.png

 

 

Headcount by Group =
COUNTROWS (
FILTER (
VALUES ( Employees[User ID] ),
COUNTROWS (
FILTER (
'Group',
[Total hours Capacity] > 'Group'[Min]
&& [Total hours Capacity] <= 'Group'[Max]
)
) > 0
)
)
 
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Thank you for responding. I have three DAX Measures, one for Total Headcount, one for Total Hours, and one for capacity/budget hours. The main Employee table is large with Employee ID in multiple rows. I cannot count rows, I cannot "SUMMARIZETABE". I want to know how many employees are within 0-50%. 51%-75%, 76%-100%+ of the capacity/budgeted hours. Three DAX measures. 

I like the Group table, played around with it yesturday. Can I build a group table to compare Total Hours againg Capacity/Budgeted hours? Like 15 Employees worked 25% of the capacity/budgeted time? 

 

Thanks again 

Hi, @Higgs11 

Thank you for your feedback.

Sorry that I quite do not understand your question.

What do you mean by,  I cannot count rows, I cannot "SUMMARIZETABE" ?

Please share your sample pbix file's link, then I can try to look into it.

Thanks.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.