Forum Discussion

BenEaton's avatar
BenEaton
Frequent Visitor
9 years ago
Solved

Manning Forecast

Hello all!   I'm looking to create a forecast of the manning level in my organisation over a couple of years, taking into account fixed term contracts.  I have their names, join date and projected ...
  • v-qiuyu-msft's avatar
    9 years ago

    Hi BenEaton,

     

    If I understood you correctly, you want to calculate the number of stilled working employees, right?

     

    You can create a calendar table:

     

    Calendar = CALENDAR(MIN('Table1'[Join]),MAX('Table1'[End]))

     

    Then create a measure in Table1:

    Still Employed = COUNTAX(FILTER(ALL(Table1),[End]>=MAX([End])),[Name])

     

    Create a new table:

    Table = DISTINCT(SELECTCOLUMNS('Calendar',"Date",[Date],"Still Employeed",COUNTAX(FILTER(ALL(Table1),[End]>=EARLIER('Calendar'[Date])),[Name])))

     

    Add a forecast line to the line chart.

     

     

    Best Regards,
    Qiuyun Yu

     

  • BenEaton's avatar
    BenEaton
    9 years ago

    I might have figured it out as COUNTAX(FILTER(Plot,[Join]<=EARLIER(Calendar[Date]) && [End]>=EARLIER(Calendar[Date]))), it appears to show what I need it to!  I am still a bit confused about the use of EARLIER, but it does what I need it to and some more playing with the expression might be more revealing.

     

    Many thanks v-qiuyu-msft for a bit of guided learning!  If there's a more logical way of writing what I have written please let me know!  If only now I can add a slicer I'm fully set!

     

    Ben