Forum Discussion

tpal415's avatar
tpal415
Frequent Visitor
6 years ago

Employee Utilization - incorrect totals

I am trying to figure out how to build a formula that will provide the utilization for multiple employees reporting different billable hours and also with different working hours due to when they started. Hours are reported by day with multiple employees in the same column and hours in another column. I've calculated working hours within a master calendar table.

 

I'm trying to divide billable hours by working hours, using the calendar to dynamically filter by month, quarter, etc. Ideally I would like to use this to have each employee on a row with utilization and then the total being entire utilization.

 

Below is the utilization table, but totals are incorrect calculated as such:

  • Employee Utilization = iferror([Billable Hours] / sum('Calendar'[WorkHours]), blank())
 
Billable hours and work hours are measures: 
  • Billable Hours = CALCULATE(SUM('2 Hours'[Logged Hours]),FILTER('2 Hours',[Billable Status]="1"))
 
  • WorkHours = VAR WeekDayNum =  WEEKDAY ('Calendar'[Date] )
    RETURN (IF (OR ( OR ( WeekDayNum = 1, WeekDayNum = 7 ), RELATED ( '6 Holidays'[Holiday Start Date[Date] ) <> BLANK ()),0, 8))
Utilization by month

 

The row values seem to be very close, but I believe it is calculating each employees billable hours by the total available hours and not totaling correctly.

 

7 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    tpal415 - I have a utilization recipe in my book, DAX Cookbook, it is Recipe 1, Chapter 8. 

    https://github.com/gdeckler/DAXCookbook

     

    If you can post sample data that would help. 

     

    Looks like you measure total is off. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

    Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
    https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

     

    Finally, since I see you are a New Member, please check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

    Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

    The most important parts are:
    1. Sample data as text, use the table tool in the editing bar
    2. Expected output from sample data
    3. Explanation in words of how to get from 1. to 2.

  • tpal415's avatar
    tpal415
    Frequent Visitor

    Greg_Deckler Thank you for the quick reply! I utilized your recipe and it worked great, the totals are correct and much easier. My only issue is if an employee had not started it still divides total billable hours by total work hours, resulting in inacurratly low utilization. How can I filter out my total working hours for each unique individual employee?

     

    Here are the calculations I used from your recipe:

     

     

    % Utilization = 
        VAR __Table = SUMMARIZE('2 Hours','2 Hours'[Employee Name]) 
        VAR __TotalBillableHours = SUMX(__Table,[Total Billable Hours]) 
        VAR __TotalHours = SUMX(__Table,[Total Hours])
        VAR __Utilization = DIVIDE(__TotalBillableHours,__TotalHours,0)
    RETURN
        IF(ISBLANK(__Utilization),0,__Utilization)

     

     

     

    Total Billable Hours = 
        var _Category = MAX('2 Hours'[Billable Status])
    Return    
    IF(
        _category = "0",
            0,
            SUMX(
                FILTER(
                    '2 Hours','2 Hours'[Billable Status] = "1"
                ),
                '2 Hours'[Logged Hours]
            )
        )

     

     

     

    Total Hours = 
        switch(max('2 Hours'[Column]),
        "Full-Time", SUM('Work Hour Calendar'[Work Hours]),
        blank()
    )

     

     

    Here is the result:

     

    Employee Name123456789101112Total
    Employee 169%61%66%100%92%103%58%81%6%0%0%0%54%

     

    Below is my data:

     

    People IDProject IDLogged DateTaskLogged HoursBillable StatusEmployee NameEmployee TitleEmployee Hourly RateEmployee Status
    171876642970412Thursday, January 2, 20202. Fieldwork31N/AAnalyst200Full-Time
    2627322849029Thursday, January 2, 202002. Business Development40N/AManaging Director & Co-Founder300Full-Time
    2627322849029Thursday, January 2, 20200. Admin41N/AManaging Director & Co-Founder300Full-Time
    2627442854215Thursday, January 2, 20204. QA61N/ADirector275Full-Time
    4421542691602Thursday, January 2, 20202. Internal Audit01N/AManager250Full-Time
    170556192855539Thursday, January 2, 2020Onsite Audit Support81N/AConsultant225Full-Time
    170900272856177Thursday, January 2, 20202. Internal Audit01N/ASenior Analyst225Full-Time
    171876642982088Thursday, January 2, 2020 31N/AAnalyst200Full-Time
    2627442856293Thursday, January 2, 20201. Project Planning61N/ADirector275Full-Time
    171876642849029Thursday, January 2, 20200. Admin20N/AAnalyst200Full-Time
    171876642855500Thursday, January 2, 20202. Fieldwork11N/AAnalyst200Full-Time
    171688712856293Thursday, January 2, 20202. Internal Assessments01N/AAnalyst225Full-Time
    170900272849029Thursday, January 2, 2020 81N/ASenior Analyst225Full-Time

     

    Thank you for any help, this has already got me on the right track!

    • tpal415's avatar
      tpal415
      Frequent Visitor

      Greg_Deckler 

       

      Still haven't quite figured out how to incorporate start and end dates into total work hours for each employee using your utilization formula. I bought and read through the utilization chapters within your book, but cannot see an explanation on how to calculate work hours by individual employee, only an aggregation of total possible working hours. Any help would be appreciated!

      • Greg_Deckler's avatar
        Greg_Deckler
        Icon for Community Champion rankCommunity Champion

        tpal415 - See if this helps, attached PBIX from my other book, Learn Power BI which goes through the whole utilization stuff in detail.

         

        I am thinking maybe:

        Total Hours = 
            VAR __Start = MAX('Employee Table'[Start Date]),
        RETURN
            switch(max('2 Hours'[Column]),
            "Full-Time", SUMX(FILTER('Work Hour Calendar',[Date]>__Start),[Work Hours]),
            blank()
        )

        Something like that.