Forum Discussion

kevinpbi's avatar
kevinpbi
Frequent Visitor
2 years ago
Solved

Seeking help for Utilization rate calculation and presenting it over a matrix table

I would like to calculate the utilization % of the employees and present the data over a matrix table.   I have the following DAX but it doesn’t seem to tally up correctly. x_Utilization% =    C...
  • talespin's avatar
    2 years ago

    hi kevinpbi 

     

    I used the sample data which you shared, there are some changes between your and mine data model. Listing everything below.

     

    1. Data model

    -There are no limited relationship, like in your datamodel.

    -I have used one to many relationship and single direction. Both tables filter Timesheet table.

     

    2.  Used Matrix with Year, month, Country, Empoyee Name and Activity type.

    Create these measures and put them in Values. I have verified the numbers per logic shared by you. Please test them thoroughly.

     

    Measure1

    Count Working Days =
    CALCULATE( COUNT('CALENDAR'[Date]), 'CALENDAR'[IsWorkingDay])
     
    Measure2
    Total Duration hours = SUM(Timesheet[DurationInHours])
     
    Measure3
    Utilization Pct =
    VAR _WorkHrsPerDay = 8
    VAR _WorkingDays = [Count Working Days]
    VAR _PlannedWrkHrs = (_WorkingDays*_WorkHrsPerDay)
    VAR _CountEmployee = CALCULATE(COUNT(DimEmployee[EmployeeName]), REMOVEFILTERS(Timesheet[ActivityType]), DimEmployee[Status] = "Active" )
    VAR _AllEmpPlannedWrkHrs = (_PlannedWrkHrs*_CountEmployee)
    RETURN DIVIDE([Total Duration hours], _AllEmpPlannedWrkHrs)