Good Afternoon, I'm trying to run the following Function, however if the answer is negative it just shows as Error, is there a way to get this to show the actual Negative number instead?
I'm very new to the world of Power Query, so any help is gratefully received.
(StartDate as date, EndDate as date, HolidayList as list) as number =>
let
Weekend = #table(type table[Weekday = Int64.Type],{{0},{6}}),
Holidays = Table.FromColumns({HolidayList},type table[Weekday = date]),
Dates = Table.FromColumns({List.Dates(StartDate,1+Duration.Days(EndDate-StartDate),#duration(1,0,0,0))}, type table[Dates = date]),
#"Inserted Day of Week" = Table.AddColumn(Dates, "Day of Week", each Date.DayOfWeek([Dates]), type number),
#"Merged Queries" = Table.NestedJoin(#"Inserted Day of Week",{"Day of Week"},Weekend,{"Weekday"},"Inserted Day of Week",JoinKind.LeftAnti),
#"Merged Queries1" = Table.NestedJoin(#"Merged Queries",{"Dates"},Holidays,{"Weekday"},"Holidays",JoinKind.LeftAnti),
NetWorkdays = Table.RowCount(#"Merged Queries1")
in
NetWorkdays
I'm very new to the world of Power Query, so any help is gratefully received.
(StartDate as date, EndDate as date, HolidayList as list) as number =>
let
Weekend = #table(type table[Weekday = Int64.Type],{{0},{6}}),
Holidays = Table.FromColumns({HolidayList},type table[Weekday = date]),
Dates = Table.FromColumns({List.Dates(StartDate,1+Duration.Days(EndDate-StartDate),#duration(1,0,0,0))}, type table[Dates = date]),
#"Inserted Day of Week" = Table.AddColumn(Dates, "Day of Week", each Date.DayOfWeek([Dates]), type number),
#"Merged Queries" = Table.NestedJoin(#"Inserted Day of Week",{"Day of Week"},Weekend,{"Weekday"},"Inserted Day of Week",JoinKind.LeftAnti),
#"Merged Queries1" = Table.NestedJoin(#"Merged Queries",{"Dates"},Holidays,{"Weekday"},"Holidays",JoinKind.LeftAnti),
NetWorkdays = Table.RowCount(#"Merged Queries1")
in
NetWorkdays