Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Calculate average with reference to another table - matrix

I'm struggling with the below case. I have created a measure which calculates total number of hours per certain activities: SUM_Activities12 = CALCULATE(SUM(activities[TimeSpent]),activities[Activi...
  • hnguy71's avatar
    hnguy71
    2 years ago

    Hi Anonymous ,

    My apologies, seems like you've already added up number of employees in your other table. In that case, you'll just need to do the sum:

    Employees = SUM(employees[Number of employees])

     

    then divide the two measures:

    Average Employee Time = 
    VAR _Hours = [SUM_Activities12]
    VAR _Employees = [Employees]        // Employees = SUM(employees[Number of employees])
    RETURN
    DIVIDE(_Hours, _Employees)

     

    Based on your sample data I would return this expected output: