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
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

 

 

View solution in original post

4 REPLIES 4

@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

 

 

@amitchandak 

 

It works!!

 

Thanks a lot!

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.