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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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