Forum Discussion
Headcount over time
- 4 years ago
Hi, cgallegos
You can refer to the following methods.
Occurence = CALCULATE ( COUNT ( 'Table'[Action] ), FILTER ( 'Table', [Name] = EARLIER ( 'Table'[Name] ) && [Effective Date ] <= EARLIER ( 'Table'[Effective Date ] ) && [Action] = EARLIER ( 'Table'[Action] ) ) )Is this the result you expect? If the method I provided above can't solve your problem, what's your expected result? You can advance a display chart of your desired results or a simple PBIX file for testing.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Try something like this:
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!
My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/
Thank you for your help, I appreciate it. This did not work, however, i don't believe it's on your end. I think the data I have is more complex than I was thinking and will require us to use a different report.
For each action such as a Termination or Hire, the employee will have a new row. Is there another way to capture headcount like this? I am thinking something like finding the 1st instance of Hire and 1st instance of termination, then seeing if they were active at the dashboard selected point in time? If not, then check the 2nd instance of hire/rehire and 2nd instance of termination, check to see if they were active at the dashboard selected point in time?
Green column is what I need to build in PBI.
| Empl ID | Name | Action | Effective Date | Occurence |
| 252 | Chuck | HIRE | 03/09/2020 | 1 |
| 252 | Chuck | TERM | 08/10/2020 | 1 |
| 252 | Chuck | HIRE | 04/10/2021 | 2 |
| 252 | Chuck | TERM | 08/27/2021 | 2 |
| 253 | Kay | HIRE | 04/15/2020 | 1 |
| 253 | Kay | TERM | 08/14/2020 | 1 |
| 253 | Kay | HIRE | 09/08/2020 | 2 |
Then maybe I can create another table that looks up their various hire and term dates
| Empl ID | 1st Hire | 1st Term | 2nd Term | 2nd Term |
| 252 | 03/09/2020 | 08/10/2020 | 04/10/2021 | 08/27/2021 |
| 253 | 04/15/2020 | 08/14/2020 | 09/08/2020 |
Please let me know if this is something you can help with or if you need additional background on it.
Thank you!
- v-zhangti4 years agoCommunity Support
Hi, cgallegos
You can refer to the following methods.
Occurence = CALCULATE ( COUNT ( 'Table'[Action] ), FILTER ( 'Table', [Name] = EARLIER ( 'Table'[Name] ) && [Effective Date ] <= EARLIER ( 'Table'[Effective Date ] ) && [Action] = EARLIER ( 'Table'[Action] ) ) )Is this the result you expect? If the method I provided above can't solve your problem, what's your expected result? You can advance a display chart of your desired results or a simple PBIX file for testing.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.