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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mvgust
Helper III
Helper III

Count Employees With Hours >= 25%

I've setup a data table where I'm calculating each employee's union hours as a percentage of total hours per week.  What I need to do, is count the number of employees which have at least one week with a % of total >=25%.  Below is an example table I've created.  For example, Tim Smith has 2 weeks where he had over 25% of his time as union time.  I only want to include him in the count, I don't want to count the number of instance he has. 

So, for the example table below, I have 6 employees where they have at least one instance of union hours >=25%

Employee IDWeek Ending DateEmployee - HIDTimecard IDUnion TimeAll Other HoursTotal Hours% of TotalCount I want
995441910/23/2022John Doe84344732496.5120.5019.92% 
227413110/23/2022Tim Smith842835840 40.00100.00%1
227413111/6/2022Tim Smith843695540 40.00100.00% 
227413110/30/2022Tim Smith8433180251540.0062.50% 
191241210/23/2022Deb Jones842665513940.002.50% 
421640110/23/2022Tanya Doe8426640152540.0037.50%1
354521511/6/2022Tim Jones844338340 40.00100.00%1
354521510/23/2022Tim Jones8426386192140.0047.50% 
375237810/23/2022Jacob Allen8426538391150.0078.00%1
164601610/30/2022Chris Talbot843583723840.005.00% 
128194110/23/2022Doug Hempler8426191567.572.506.90% 
003923010/23/2022Ian Hunt842808340 40.00100.00%1
003923010/30/2022Ian Hunt843512340 40.00100.00% 
003923011/6/2022Ian Hunt844276740 40.00100.00% 
788414410/30/2022Ron Irish8430803845.753.7014.90% 
788414410/23/2022Ron Irish8442593757.564.5010.85% 
657216110/23/2022Paul Jet842959840 40.00100.00%1
657216110/30/2022Paul Jet843216453540.0012.50% 
         
 Total Employees with at least one week >=25% of Total    6

 

 

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

try to create a measure with the code below:

 

Count =
COUNTROWS(
    FILTER(
        VALUES(Data[Employee - HID]),
        CALCULATE(MAX(Data[% of Total]))>=0.25
    )
)

View solution in original post

2 REPLIES 2
mvgust
Helper III
Helper III

@FreemanZ Thank you!  Works as I need it to.

FreemanZ
Super User
Super User

try to create a measure with the code below:

 

Count =
COUNTROWS(
    FILTER(
        VALUES(Data[Employee - HID]),
        CALCULATE(MAX(Data[% of Total]))>=0.25
    )
)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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