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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
alexcatala
Helper IV
Helper IV

employees under 23 dynamic

Hi, I am trying to figure it out the number of employees under 23 who are currently active.

 

I have the formula for the employees under 23 :

 

23 age = CALCULATE(COUNTROWS(FILTER('f_Employees',f_Employees[EmpAge] <=23)))
 
Also, the formula to know the currently active employees:
 
active2 employees = var currentdate = MAX(d_DateTable[Date])
return CALCULATE(DISTINCTCOUNT(f_Employees[EmplCode]),f_Employees[EmpJoinDate]<=currentdate,or(ISBLANK(f_Employees[EmpLeavDate]),f_Employees[EmpLeavDate] > currentdate))
 
How can I obtain the number of employees under 23 that are currently active?
 
Thanks
1 ACCEPTED SOLUTION

@alexcatala , if age is a column

active2 employees = var currentdate = MAX(d_DateTable[Date])
return CALCULATE(DISTINCTCOUNT(f_Employees[EmplCode]),f_Employees[EmpJoinDate]<=currentdate,or(ISBLANK(f_Employees[EmpLeavDate]),f_Employees[EmpLeavDate] > currentdate),'f_Employees',f_Employees[EmpAge] <=23)

 

if measure please share formula

 

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@alexcatala , Please refer to this

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak I have already the formula for the active employees, but as I am trying to figure it out how many of them are under 23, it might be a different formula.

 

I used 2 measures to calculate employees under 23 and also to find out the active employees.

 

Now I only need how to link between them and make it work.

@alexcatala , if age is a column

active2 employees = var currentdate = MAX(d_DateTable[Date])
return CALCULATE(DISTINCTCOUNT(f_Employees[EmplCode]),f_Employees[EmpJoinDate]<=currentdate,or(ISBLANK(f_Employees[EmpLeavDate]),f_Employees[EmpLeavDate] > currentdate),'f_Employees',f_Employees[EmpAge] <=23)

 

if measure please share formula

 

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak 

 

It works!!

 

Thanks a lot!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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