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
tpal415
Frequent Visitor

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 monthUtilization 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 7
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!

@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!

Hi @tpal415

 

Is your issue solved now?

 

 
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

@Kelly Unfortuantely no.  I believe my issue is with calucalting total hours available. I can't quite figure out how to calculate the total work hours available by each individual employee when employees have different start dates. I have a calendar with the total work hours and another table with employee start dates, but cannot tie the two together. The billable hours is correct, and totals are all summing correclty, but below are the outputs:

 

Total Hours:

 

#TotalHours = 
    VAR __Start = MAX('7 People'[Start Date])
RETURN
    switch(max('2 Hours'[Employee Type]),
    "Full-Time", SUMX(FILTER('Work Hour Calendar',[Date]>__Start),'Work Hour Calendar'[WorkHours]),
    blank()
)

 

Output:

Total Hours.png

*Here is the issue - it's good that only the numbers are showing up in months where people have input hours, but again it's taking the entire month of work hours, not by day and also only months 7-12 which is most likely because the most recent (max) start date was mid July. This obviously throws everything else off.

 

Total Hours by Employee:

 

#TotalHoursByEmployee = SUM('Work Hour Calendar'[WorkHours])

 

Output:

Total Hours by Employee.png

 

Total Billable Hours:

 

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]
        )
    )

 

Output:

Total Billable Hours.png

 

 Utilization:

 

%Utilization = 
VAR __utilization = DIVIDE([Total Billable Hours],[#TotalHours],0)
VAR __days = countrows('2 Hours')
RETURN
    IF(ISINSCOPE('7 People'[Employee Name]),
        IF(
            Isblank(__Days),
            BLANK(),
            IF(
                ISBLANK(__utilization),
                0,
                __utilization
            )),
        VAR __tempTable = 
            SUMMARIZE(
                '2 Hours',
                '2 Hours'[Employee Name],
                "__billableHours",[Total Billable Hours],
                "__totalHours",[#TotalHours]
            )
        VAR __totalBillableHours = SUMX(__tempTable,[__billableHours])
        VAR __totalTotalHours = SUMX(__tempTable,[__totalHours])
        RETURN
            DIVIDE(__totalBillableHours,__totalTotalHours,0)
)

 

Output:

Utilization.png

 

 

Hi  @tpal415 ,

 

It's a subtotal issue,a very common issue,could you pls upload your .pbix file to Onedrive business and share the link with me?(Remember to remove the confidential information)

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

@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.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Super User
Super User

@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.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.