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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
ejafarov
Helper I
Helper I

Calculating Staff Count with DAX

Hi everyone,

 

I hope all of you are safe and doing well.

 

i want to write a query that calculates the staff count within the company by date. My Dax is below.

 

StaffCount = CALCULATE(COUNT(P[ID]),
FILTER(pli, P[Start_Date]<=MAX('Calendar'[Date]) && P[Resignation_date]<P[Start_Date]))
 
 
But when I filter for example Quarter 3 that only calculates the number of hiring not active employees. So basically I want to get a number of active employees when I filter one date. 
Could you please help me to solve this issue?
 
THanks 
BR,
Eshgin
1 ACCEPTED SOLUTION
Mahesh0016
Super User
Super User

@ejafarov Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

View solution in original post

2 REPLIES 2
Mahesh0016
Super User
Super User

@ejafarov Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Dear @Mahesh0016, unfortunately I can not insert the file here. could you please write your e-mail so I can send file to you

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.