Forum Discussion
Sal29
3 years agoFrequent Visitor
Power Query Multiple conditions - SLAs
Hi, I am faced with a Power Query problem, and I hope someone can support me, here is a link to a sample file of orders and Public Holiday tables from our database connected to a Power Bi Report Pow...
rubayatyasmin
3 years agoCommunity Champion
try the solutions first. then let me know if it doesn't work. I will try to look into it
Sal29
3 years agoFrequent Visitor
unfortunately I'm stuck with the function, here is what I adopted from your code. I have also added the table of all holidays on the main post.
let
NextBusinessDay = (inputDate as date) as date =>
let
nextDay = Date.AddDays(inputDate,1),
nextWeekday = if Date.DayOfWeek (nextDay,Day.Monday) > 4 then Date.AddDays(nextDay,7 - Date.DayOfWeek(nextDay,Day.Monday)) else nextDay,
BankHolidays = BankHolidayCalendar (#"Bank holiday","Date"),
result = if List.Contains (BankHolidays, nextWeekday) then @NextBusinessDay(nextWeekday) else nextWeekday
in
result
in
NextBusinessDay