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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Employee Count - based on Slicer Selection

Good Morning,

I have an interesting problem to solve - 

KPI is Count of Active Employees 

Slicers are Year, Quarter, Month

Data has employee id along with employee start date and employee end date.  

KPI needs to reflect the active employee count based on what the user selects in any of the slicers.  

 

If the user selects Year 2022 and Qtr Q1, and an employee leaves in Feb, the employee should be counted because employee was active in Q1.

 

I tried the following - but thats not the full solution -
Active Employee Count = Calculate(DISTINCTCOUNTNOBLANK('Emp-Data'[RACFID]),
            'Emp-Data'[start_date] <= Today(), 'Emp-Data'[end_date] >= Today())
)
 
Please suggest how to make it work with the Year, Qtr, and Month slicers.
 
Many thanks!!
2 REPLIES 2
Anonymous
Not applicable

Thanks Lucien.

i created a range - min data and max date based on what the user selected in the Year, Qtr, Month slicers.

Then i counted Active employees based on an overlap in the employee start and end date and in the selected range.

It works!

v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

Could you pls share a smaple data and expect output result.Remember to remove confidential data.

 

 

Best Regards

Lucien

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.