Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Difference in Count of Employees Joining vs. Leaving in a month

My dataset has three columns: Employee ID, Start Date and End Date.

 

Based on this, we created two charts:

1)Headcount Onboard by Year: Shows the number of employees joining by month (count of employee id and start date).

2) Headcount Offboard by Year: Shows the number of employees leaving by month (count of employee id and end date).

 

Headcount.PNG

 

I want to create a chart that shows the difference between the two by month (headcount variance). How do I do this?

1 ACCEPTED SOLUTION
v-diye-msft
Community Support
Community Support
10 REPLIES 10
v-diye-msft
Community Support
Community Support

amitchandak
Super User
Super User

@Anonymous , if both dates are on same table or different tables. The solution will have a small difference.

 

But refer to this blog or video.

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970

https://youtu.be/e6Y-l_JtCq4

 

 

EricHulshof
Solution Sage
Solution Sage

I saw the message in the spanish channel already, so i will react here before its translated 😉

The measure would be a bit trickier to write, but i think it would be something like;

measure = CALCULATE(COUNT(Id), Startdate) - CALCULATE(Count(id),enddate)


Not exactly sure though, typing this from my phone. If you could provide me a sample dataset i will write the measure for you first thing in the morning. 🙂

Eric. 


Quality over Quantity


Did I answer your question? Mark my post as a solution!


Anonymous
Not applicable

Thanks! Really appreciate it!

The sample dataset is below. I need a breakdown by month for my chart. Example - the breakdown for March 2020 should be -1 (2 people joining in March 2020 and 3 people leaving, so 2-3).

Here is the sample dataset:

EMPLOYEE ID START DATEEND DATE
84612/31/201503/01/2020
371203/01/201503/31/2021
370003/26/202003/31/2021
86703/02/202003/31/2021
480004/01/201903/01/2020
569101/04/201603/01/2020

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

 Thank you Ashish! I am having trouble opening the file, but if it isn't too much trouble can you share the logic and the queries? Thanks!

Hi,

The file is downloading just fine.  Please retry.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Thanks Ashish - I am having trouble opening because I am on an older version of Power BI. Unfortunately my organization has blocked the update for some reason. If it's not too much trouble, could you share the logic and queries. Thanks so much!

Hi,

There are actually quite many steps there so writing them here is not feasible.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
EricHulshof
Solution Sage
Solution Sage

Hey, 

 

You can create a measure, something like:

Measure = SUM(OnboardByyear) - SUM(OffboardByYear) 


With sample data i could test it and make sure it works. But this should work. 

Goodluck! 


Quality over Quantity


Did I answer your question? Mark my post as a solution!


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.