Forum Discussion

mvgust's avatar
mvgust
Icon for Helper III rankHelper III
3 years ago
Solved

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

 

 

  • try to create a measure with the code below:

     

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

2 Replies

  • try to create a measure with the code below:

     

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