Forum Discussion
Gusd8
1 year agoHelper I
Query Function, return value and not table...
Greetings, thank you for looking... The situation is...I have to calculate SLAs on various rules. I have taken teh approach of having a "Start Time" and then calculating an "Expected Finish" time...
lbendlin
1 year agoSuper User
Source = List.Dates(StartDate,1,#duration(1,0,0,0)),
Instead you could write {StartDate}.
Is your weekend Saturday/Sunday? Better specify the FirstDayOfWeek parameter to avoid ambiguity in international setups.
Here's a simplified version that returns the scalar value you requested.
(StartDate)=>
DateTimeZone.From(
List.RemoveItems(
List.Select(
List.Dates(StartDate, 7, #duration(1, 0, 0, 0)),
each List.Contains({1 .. 5}, Date.DayOfWeek(_))
),
HolidayList
){0}
)
+ #duration(0, 8, 0, 0)