0

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?

1
  • What is the error? I cannot reproduce your problem. If I input null, the result is null. Please provide sufficient information so I can reproduce your problem. Commented Jan 23, 2022 at 21:34

2 Answers 2

1

Try

try input/1000 + 500 otherwise null
Sign up to request clarification or add additional context in comments.

Comments

1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.