Power Query - Function IF null

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?


Try

try input/1000 + 500 otherwise null

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