Forum Discussion

pedromenu's avatar
pedromenu
Regular Visitor
3 years ago
Solved

Count Employees

I have a spreadsheet with employee hours in hours. When there are no entry and exit records, it is considered a failure. In this case, I need to make two cards:

1) number of days where more than 20% of employees were late

2) Create a card with the number of employees who have a percentage of days late greater than or equal to 50%.

 

How can I do this?

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi pedromenu ,

    Please have a try.

    Create a measure.

    Late Days = 
               COUNTROWS(FILTER('Table', 'Table'[Late] > 0)) / DISTINCTCOUNT('Table'[Date]) * 100

    This formula calculates the percentage of days where more than 20% of employees were late. You can then create a card visual and add the "Late Days" measure to it.


    Create the 2nd measure.

    Late Employees = COUNTROWS(FILTER('Table', 'Table'[Late] / 'Table'[Total] >= 0.5))

    This formula calculates the number of employees who have a percentage of days late greater than or equal to 50%. You can then create another card visual and add the "Late Employees" measure to it.

     

    How to Get Your Question Answered Quickly 

     

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

     

    Best Regards
    Community Support Team _ Rongtie

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi pedromenu ,

    Please have a try.

    Create a measure.

    Late Days = 
               COUNTROWS(FILTER('Table', 'Table'[Late] > 0)) / DISTINCTCOUNT('Table'[Date]) * 100

    This formula calculates the percentage of days where more than 20% of employees were late. You can then create a card visual and add the "Late Days" measure to it.


    Create the 2nd measure.

    Late Employees = COUNTROWS(FILTER('Table', 'Table'[Late] / 'Table'[Total] >= 0.5))

    This formula calculates the number of employees who have a percentage of days late greater than or equal to 50%. You can then create another card visual and add the "Late Employees" measure to it.

     

    How to Get Your Question Answered Quickly 

     

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

     

    Best Regards
    Community Support Team _ Rongtie

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

  • pedromenu's avatar
    pedromenu
    Regular Visitor

    Hello Anonymous  ,

    I had to redo some calculations, but based on the measurements you sent me, it worked.
    Thanks a lot for the help!