# Number of working days exc. weekends between two given dates

Good morning all,

I need to calculate the difference between start date and actual date of leaving for employees. The number of working days should exclude Saturdays and Sundays.

I have tried several ideas found online and all the measures are in the attached PBI file. Still, the outcome of all of them is incorrect. Can’t navigate the problem here.

Grateful as always.

Iwona

Does this get closer tot he proper figures?

``````WorkingDaysOnly =
VAR SlctStartDate = Max('Leavers-NEW'[Start Date])
VAR SlctEndDate = MAX('Leavers-NEW'[Actual date of leaving])
VAR DaysInPeriod = DATESBETWEEN(DIM_TIME_WORKED_HOURS[OP_DATE],SlctStartDate,SlctEndDate)
VAR Result = CALCULATE(COUNTROWS(DIM_TIME_WORKED_HOURS),DaysInPeriod,NOT DIM_TIME_WORKED_HOURS[OP_DAYOFWEEKNO] IN{7,1} )
RETURN Result
``````

Hello @Iwona

Did the responses above help solve your query?

If not, can you let us know where you’re stuck and what additional assistance you need?

If it did, please mark the answer as the SOLUTION by clicking the three dots beside Reply and then tick the check box beside SOLUTION

Thank you

I would like to say a big thank you to you for your time/help/knowledge.

Iwona

1 Like