Forum Discussion

Dimitris_Kats's avatar
4 years ago
Solved

Annual Headcount Average

Hello. I was hoping you could help me calculate an annual average headcount. I have a table with all the employees month by month, and I have a date table as well. The employee table looks like th...
  • ValtteriN's avatar
    4 years ago

    Hi,

    This is one way to do this:
    data:

    Dax:

    RT empID average =
    var maxdate = MAX('Calendar'[Date])
    var rt =
    CALCULATE (
    COUNT('Average of empid'[ID]), --
    ALL('Average of empid'),'Average of empid'[Date]<=maxdate)
    var _monthnum = MONTH(MAX('Calendar'[Date]))
    return

    Divide(rt,_monthnum)


    End result:

    I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!