Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Power BI Query - 2 arguments were passed to a function which expects 3

I am new to Power BI Query. I have written this query to be able to calculate networkdays:
 

(Created as date, Closed as date, Holiday as list) as number => let ListDates = List.Dates (Created, Number.From (Closed-Created), #duration(1,0,0,0)), RemoveWeekends = List.Select(ListDates, each Date.DayOfWeek(_, Day.Monday)< 5), RemoveHolidays = List.RemoveItems (RemoveWeekends,Holiday), CountDays=List.Count(RemoveHolidays) in CountDays

 

It has returned an error saying:

Expression.Error: 2 arguments were passed to a function which expects 3. Details: Pattern= Arguments=[List]

 

Can anyone help me pinpoint what this error means and where I may have messed up the query?

1 Reply

  • Hello - when I invoke the function I don't get an error.  Your function has three required arguments, so three must be entered when the function is invoked, like the snip below.  From the error message, it looks like perhaps a list of holiday dates is not be included.