How do I implement a Try...Catch block in Power Query M?

Responsive Ad Header

Question

Grade: Education Subject: Support
How do I implement a Try...Catch block in Power Query M?
Asked by:
56 Viewed 56 Answers

Answer (56)

Best Answer
(314)
You implement Try...Catch using the `Try...Otherwise` function. The general syntax is `Try...Otherwise { Expression }`. The `Expression` inside the curly braces is evaluated. If an error occurs, the `Otherwise` block is executed instead. For example: `Try...Otherwise { Text.From(Value.Error(”Error occurred”)) }`