
In Power BI, I have the following metric:
I need to calculate the average number of total number of employees in the fiscal year (Nov. 2020-Oct. 2021) based on the maximum number of employees in one month. Obviously this number changes weekly. This number is not captured in any way.
There are two dates of interest:
The employee start date and employee inactivated date. In addition, the users active status.
So is this possible to do in SQL? Would you recommend writing a stored procedure that populates a table?
The 3 datapoints you noted are all in the UPR00100 (plus one alternate date you may want).
select STRTDATE,LASTDAYWORKED_I,DEMPINAC,Inactive,* from UPR00100
The columns above map to the following in the employee Maintenace window.
STRTDATE: Hire date
LASTDAYWORKED_I: last day worked (not a required field)
DEMPINAC: Date inactivated.
Inactive: Is the employee active (0) or inactive (1).