Okay so give this a try.
-
Create a New from Blank Query and call it MinDate
-
Create another called MaxDate
-
Change the Custom Column M code to
let LBound = if [FromDate] < MinDate then MinDate else [FromDate], UBound = if [ToDate] > MaxDate then MaxDate else [ToDate] in List.Select( List.Difference( List.Dates( LBound, Number.From( UBound - LBound ) +1, Duration.From(1)), List.Transform(#"Holiday Table"[Holiday Date], Date.From )), each Date.DayOfWeek(_, 1) < 5 )
.
I hope this is helpful.