As with any programming language, coding DAX calculations will inevitably result in an error being generated. While error handling in DAX is perhaps not quite as mature and robust as some other programming languages, DAX does provide some basic capabilities for handling errors within DAX code. This recipe demonstrates how to use three special DAX functions, ERROR, ISERROR, and IFERROR, in order to perform basic error checking within DAX calculations.
Handling errors with ERROR, ISERROR, and IFERROR
Getting ready
To prepare for this recipe, perform the following steps:
- Open Power BI Desktop.
- Use an Enter Data query to create a table called R01_Table with the following data:
Color |
Value |
Red |
0 |
Green |
1 |
... |