Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi everyone,
I need to schedule employee start and end by half-hour, depending on an expected and needed number
Here are my data :
I need to calculate three more columns :
"Start" : number of employees that need to start at each half hour to reach the expected number
"End" : number of employees that need to start at each half hour. A work day last 8:30 hour for each employee, so this is start + 8:30
"PresentEmployee" : number of employees present at each half-hour (depending on start and end)
here is the results that i expected :
Hre is the results that i have with the following calculated columns, and i d'ont understand why...
START
Start =
VAR CurrentNum = 'EmployeeSchedule'[Numéro de la demi-heure]
VAR ExpectedEmployees = 'EmployeeSchedule'[ExpectedEmployees]
VAR EmployeesPresent =
CALCULATE(
SUM('EmployeeSchedule'[ExpectedEmployees]),
FILTER(
'EmployeeSchedule',
'EmployeeSchedule'[Numéro de la demi-heure] < CurrentNum
)
)
RETURN
MAX(0, ExpectedEmployees - EmployeesPresent)
END
End =
VAR CurrentNum = 'EmployeeSchedule'[Numéro de la demi-heure]
VAR EndNum = CurrentNum - 17
RETURN
IF(
EndNum > 0,
CALCULATE(
SUM('EmployeeSchedule'[Start]),
FILTER(
'EmployeeSchedule',
'EmployeeSchedule'[Numéro de la demi-heure] = EndNum
)
),
0
)
PresentEmployees
PresentEmployees =
VAR CurrentNum = 'EmployeeSchedule'[Numéro de la demi-heure]
RETURN
CALCULATE(
SUM('EmployeeSchedule'[Start]) - SUM('EmployeeSchedule'[End]),
FILTER(
'EmployeeSchedule',
'EmployeeSchedule'[Numéro de la demi-heure] <= CurrentNum
)
)
Thank you very much
Solved! Go to Solution.
Source Data. Here expected employees figures are randomly taken.
To calculate the desired result I have added three additional columns named Duration,End Time and Max Employee
Start
End
Present Employees
If the same way out solves your problem then please accept this as your solution. Happy to help.
Please check present employee formula. I have considered your formula only for the Present employee. If the overall solution is ok with you then please accept the same as the solution.
Source Data. Here expected employees figures are randomly taken.
To calculate the desired result I have added three additional columns named Duration,End Time and Max Employee
Start
End
Present Employees
If the same way out solves your problem then please accept this as your solution. Happy to help.
[update] it's ok, my actual formula for Present employees work perfectly [/update]
So great ! I think it's perfect !
But i can't the see Present employees colum formula. The last screenshot seems not to be the good one.
Thank you so much 🙂
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
15 | |
9 | |
7 | |
7 | |
6 |
User | Count |
---|---|
22 | |
11 | |
10 | |
10 | |
8 |