Reputation: 331
I have a specific function in Power Query like this:
let Func_Test = (input) =>
input/1000 + 500
in
Func_Test
The challange is now, that the input can contain null. If this is the case, then I get an error. How can I avoid this directly in the function?
Upvotes: 0
Views: 1227
Reputation: 60389
If I input null into your function, I get null as a response.
However if I don't input anything, the response is an error message :Expression.Error: 0 arguments were passed to a function which expects 1.
For this latter problem, just make the argument optional:
let Func_Test = (optional input) =>
input/1000 + 500
in
Func_Test
Upvotes: 1