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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Egemeny
Frequent Visitor

DAX Measure - New Hires (Still in business >6 m) and New Hires (Left the Business <6 m)

Hi everyone,

I'm quite new to Power Bi and i'm hoping that you'll be able to help me with DAX Measures. I'm working on a HR Project and i need to calculate two KPIs'.

- New hires still in the business after 6 months of their start date
- New hires left the business before 6 months of their start date

I have Status of Employment Column, if someone left the company status is 'DEACTIVE', if it's still in the business it's 'ACTIVE'.

Your help will be appreciated!
Best,
E

1 ACCEPTED SOLUTION

Hi @Egemeny ,

 

You can create measures using DAX below.

 

Active after 6 months = CALCULATE(COUNT('Master Data'[Employee Code]),FILTER('Master Data','Master Data'[Status of Employment]="Active"&&DATEDIFF('Master Data'[Date Engaged],TODAY(),MONTH)>=6))

 

Deactive within 6 months = CALCULATE(COUNT('Master Data'[Employee Code]),FILTER('Master Data','Master Data'[Status of Employment]="Deactive"&&DATEDIFF('Master Data'[Date Engaged],'Master Data'[Date of Resignation],MONTH)<6))

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

5 REPLIES 5
ayazsyed
New Member

Hi All,

How to get count of employees hired or resigned/ terminated in the current year ?

Egemeny
Frequent Visitor

Hi @v-xicai ,

Thank you for your response. As you mentioned, i'm attaching link of pbix. file.

My desire outcome is calculating,

  • How many employees are still "Active" after 6 months of employment date,
  • How many employees were "Deactive" (resigned, terminated) within 6 months of their employment date.

I hope this time i'm more clear.

Best,

E

 

Hi @Egemeny ,

 

You can create measures using DAX below.

 

Active after 6 months = CALCULATE(COUNT('Master Data'[Employee Code]),FILTER('Master Data','Master Data'[Status of Employment]="Active"&&DATEDIFF('Master Data'[Date Engaged],TODAY(),MONTH)>=6))

 

Deactive within 6 months = CALCULATE(COUNT('Master Data'[Employee Code]),FILTER('Master Data','Master Data'[Status of Employment]="Deactive"&&DATEDIFF('Master Data'[Date Engaged],'Master Data'[Date of Resignation],MONTH)<6))

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

It worked!

thank you so much.

v-xicai
Community Support
Community Support

Hi @Egemeny ,

 

I am not sure what desired result would you want, could you please share your sample data or desired output screenshots for further analysis? You can also upload sample pbix to OneDrive and post the link here. Do mask sensitive data before uploading.

Please read this post to get your answer quickly.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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