Power Query M code
let
Add = (a as number, b as number) as number => a + b,
Arguments = {5, 10},
Result = Function.Invoke(Add, Arguments)
in
Result
Invokes a function using an argument list built at runtime, instead of writing out each parameter by hand.
let
Add = (a as number, b as number) as number => a + b,
Arguments = {5, 10},
Result = Function.Invoke(Add, Arguments)
in
Result
Function.Invoke is handy when the number or order of arguments is only known at runtime, such as when building them from a table row.
Browse all 145 snippets in the Power Query M Code Snippets, or search the library for something similar to Call a Function with a List of Arguments.