Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Trying to get an As of Date or Current Date calendar search option to work on Active Employee or New Hires or Termed Employees type reports. So for example, whatever date is selected/chosen, ONLY those Active EE's on that selected date would appear. If the date selected was 11/11/2024, only Employees who were active would be on the report....basing it off Latest Hire Date field.
Anyone with experience using this type of Date option?
Created an additional column under the Employee view:
Solved! Go to Solution.
Hi @bmurphy
Try this and ensure that the dates table is not related to your employees table
Active Employees =
VAR _SelectedDate =
-- Get the latest selected date from the Dates table
MAX ( Dates[Date] )
RETURN
CALCULATE (
-- Count the number of employees
COUNTROWS ( 'Employee' ),
-- Filter for employees who have been hired on or before the selected date
'Employee'[HireDate] <= _SelectedDate,
-- Include employees who either:
OR (
-- Have no termination date (still active)
ISBLANK ( 'Employee'[TerminationDate] ),
-- Or, have a termination date in the future (still employed)
'Employee'[TerminationDate] > _SelectedDate
)
)
Sample pbix attached.
Hi @bmurphy
Try this and ensure that the dates table is not related to your employees table
Active Employees =
VAR _SelectedDate =
-- Get the latest selected date from the Dates table
MAX ( Dates[Date] )
RETURN
CALCULATE (
-- Count the number of employees
COUNTROWS ( 'Employee' ),
-- Filter for employees who have been hired on or before the selected date
'Employee'[HireDate] <= _SelectedDate,
-- Include employees who either:
OR (
-- Have no termination date (still active)
ISBLANK ( 'Employee'[TerminationDate] ),
-- Or, have a termination date in the future (still employed)
'Employee'[TerminationDate] > _SelectedDate
)
)
Sample pbix attached.
I think this actually is working! OMG. Thank you! Power BI is all new to me and so different than our reporting system I'm leaving, so I have so much to learn! I'm sure many questions ahead! I do have a question tho....how come you don't need to join it to the Employee table? Because of what's included in the measure itself?
If you do, your data gets filtered to either the hire or termination date depending on which column the relationshiop is on.
Do you mean active on the selected day or active now? could you pls provide some sample data and the expected output?
Proud to be a Super User!
Thank you for responding/asking. It's active on the selected day. If I put in 10/31/24, I want to know who was active on that day. If I put in 07/12/2021, I want to see who was active on THAT day.
I really appreciate this and I'll take a look!
Hi @bmurphy
Have you verified the files shared by @amitchandak and @danextian ? Could you please let me know if they resolve your issue? If you have identified a solution, we kindly request you to share it with the community, as it may be helpful to others facing a similar issue.
If you find the response helpful, please mark it as the accepted solution and provide kudos, as this will assist other members with similar queries.
Thank You!
I apologize for the delay. We are a LARGE company and I needed to do some validations amongst many other day to day tasks. 🙂
@bmurphy , Please refer to the attached files. You can also check
Power BI: HR Analytics - Employees as on Date: https://youtu.be/e6Y-l_JtCq4
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
Power BI HR Active Employee Tenure Bucketing, and Hired, Terminated, and Active employees: https://youtu.be/fvgcx8QLqZU
Thank you so much for an actual example I can try and work off of. I appreciate it. Will do some validations and see if this will work! Thank you!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 43 | |
| 39 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 63 | |
| 32 | |
| 30 | |
| 23 |