Forum Discussion
Rolling 12 Month Headcount
Hi,
I understand this is a well known topic, but I can't seem to find a way to show the headcount every month factoring in the terminations and hires. I also need to be able to separate out the hires by department. I do not need just the counts of hires by month (I have that already figured out). I have tried solutions like:
Here is a sample data set along with the calendar table I used (=CALENDARAUTO()):
| PBI ID | DEPTARTMENT | Date Hired | Last Day Worked |
| B1 | ACCT | 11/15/2021 0:00 | |
| B11 | FINA | 6/21/2021 0:00 | |
| B111 | FINA | 8/13/2012 0:00 | |
| B113 | FIN | 3/1/2021 0:00 | |
| B114 | ACCT | 4/1/2014 0:00 | |
| B115 | ACCT | 2/1/2022 0:00 | |
| B116 | ACCT | 10/1/2021 0:00 | |
| B117 | SALE | 9/1/2021 0:00 | |
| B118 | SALE | 5/22/2017 0:00 | |
| B119 | SALE | 10/17/2022 0:00 | |
| B12 | SALE | 1/6/2020 0:00 | 12/1/2022 0:00 |
| B120 | SALE | 8/2/2010 0:00 | |
| B121 | SALE | 12/6/2021 0:00 | |
| B123 | HR | 1/1/2022 0:00 | 3/18/2022 0:00 |
| B124 | HR | 11/8/2021 0:00 | |
| B125 | HR | 7/1/2021 0:00 | |
| B127 | HR | 12/15/2006 0:00 | |
| B128 | HR | 4/9/2012 0:00 | 3/24/2022 0:00 |
| B13 | HR | 11/9/2015 0:00 | |
| B130 | HR | 5/16/2016 0:00 | |
| B132 | HR | 7/6/2020 0:00 | |
| B133 | MARK | 1/17/2022 0:00 | |
| B134 | MARK | 5/16/2016 0:00 | |
| B136 | MARK | 8/1/2016 0:00 | |
| B139 | MARK | 10/1/2022 0:00 | |
| B140 | MARK | 11/29/2021 0:00 | |
| B145 | MARK | 10/22/2012 0:00 | |
| B146 | MARK | 5/23/2022 0:00 | |
| B147 | MARK | 4/1/2014 0:00 | |
| B148 | ADMI | 7/1/2021 0:00 | 12/25/2022 0:00 |
| B15 | ADMI | 8/2/2021 0:00 | |
| B151 | ADMI | 2/8/2016 0:00 | 8/22/2022 0:00 |
| B153 | ADMI | 4/1/2014 0:00 | 6/24/2022 0:00 |
| B154 | ADMI | 1/1/2022 0:00 | |
| B155 | ADMI | 11/22/2021 0:00 | 3/15/2022 0:00 |
| B156 | ADMI | 9/7/2021 0:00 | |
| B158 | ADMI | 7/6/2021 0:00 | |
| B159 | ACCT | 10/31/2016 0:00 | |
| B16 | ACCT | 10/16/1987 0:00 | |
| B160 | ACCT | 5/16/2016 0:00 | |
| B165 | ACCT | 12/11/2017 0:00 | |
| B167 | JANI | 1/17/2022 0:00 | |
| B168 | JANI | 1/6/2020 0:00 | 11/10/2022 0:00 |
| B169 | JANI | 4/9/2012 0:00 | 7/1/2022 0:00 |
| B17 | JANI | 12/13/2021 0:00 | 9/2/2022 0:00 |
- Anonymous3 years ago
Hi Sgbo ,
I have created a simple sample, please refer to my pbix file to see if it helps you.
Create measures.
Measure = IF(MAX('Table'[Last Day Worked])=BLANK(),TODAY(),MAX('Table'[Last Day Worked]))Measure 2 = var _selectedvalue=MAXX(ALLSELECTED('Table 2'[Date]),'Table 2'[Date]) var _persom=CALCULATE(COUNT('Table'[PBI ID]),FILTER(ALL('Table'),'Table'[Date Hired]<=_selectedvalue&&[Measure]>=_selectedvalue)) return _persomHow to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ PollyIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- olgad
Resident Rockstar
Hi there, not directly answering your question here, but just wanted to say, the more complex my HR report was the harder was it to maintain the approach of calculating HC in between the dates. May be you just create monthly views, so you can see who is a leaver, joiner, HC in a particular month row wise.
Take a look at the second story in this article, i am always using this approach to avoid the headache.
- AnonymousNot applicable
Hi Sgbo ,
I have created a simple sample, please refer to my pbix file to see if it helps you.
Create measures.
Measure = IF(MAX('Table'[Last Day Worked])=BLANK(),TODAY(),MAX('Table'[Last Day Worked]))Measure 2 = var _selectedvalue=MAXX(ALLSELECTED('Table 2'[Date]),'Table 2'[Date]) var _persom=CALCULATE(COUNT('Table'[PBI ID]),FILTER(ALL('Table'),'Table'[Date Hired]<=_selectedvalue&&[Measure]>=_selectedvalue)) return _persomHow to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ PollyIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.