This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
Hi All,
I came across a very simple - complex (pardox) situation. I have a table like the below one with Emp_ID, Joining Date & Relieving Date with 5000 employee records for the last 20 years. I need to get a Monthly headcount report where a person has to be joined before the selected month and not relieved that month.
| Emp_ID | Joining Date | Relieving Date |
Deva
Solved! Go to Solution.
You need a calendar table and a measure like
headcount =
COUNTAX (
FILTER (
ALL ( Employees ),
Employees[Joining Date] <= MAX ( CalendarTbl[MonthEnd] )
&& (
Employees[Relieving Date] > MAX ( CalendarTbl[MonthEnd] )
|| ISBLANK ( Employees[Relieving Date] )
)
),
Employees[Emp_ID]
)
Dataset
C
You need a calendar table and a measure like
headcount =
COUNTAX (
FILTER (
ALL ( Employees ),
Employees[Joining Date] <= MAX ( CalendarTbl[MonthEnd] )
&& (
Employees[Relieving Date] > MAX ( CalendarTbl[MonthEnd] )
|| ISBLANK ( Employees[Relieving Date] )
)
),
Employees[Emp_ID]
)
Dataset
C
Hi @Deva002. Could you provide some clarification with an example? If Emp_ID 123 has a joining date of 1 June 2016 and a relieving date of 1 August 2016, they would contribute to the headcount for only the month of July 2016. However, if they joined any time in May 2016, they should contribute to the headcount for June and July 2016. Is that accurate?
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 34 | |
| 31 | |
| 25 | |
| 20 | |
| 16 |
| User | Count |
|---|---|
| 61 | |
| 49 | |
| 28 | |
| 23 | |
| 23 |