<!-- https://learnsql.cpetoday.com/functions/dax/iserror -->
# ISERROR

Language: DAX
Category: Information
Syntax: ISERROR(<value>)
Summary: Returns TRUE when a calculation returns an error.
Returns: TRUE or FALSE (a scalar).
Level: Intermediate
Related: IFERROR, ISNUMBER, ISBLANK, IF, VALUE, DIVIDE

## What it does
ISERROR tests whether an expression fails with an error. It returns TRUE only for errors, and FALSE for numbers, text and blanks. Use it to find the rows where a calculation breaks, such as a conversion that cannot read a note in an amount column, so that you can count or list the failures instead of hiding them.

## Syntax and arguments
- value: the expression to test. The expression is evaluated, and the test looks at the outcome.

## Example
A conversion of imported text amounts sometimes fails. Rather than hide the failures with IFERROR, the reconciliation counts them so the team can see how many rows need attention.

```dax
Amount Failed = ISERROR(VALUE(Imports[AmountText]))
```

Rows that convert return FALSE. Rows with a note such as "pending" return TRUE because VALUE raises an error on them. A card that counts the TRUE rows shows the number of failed lines.

## Example: a second, different use
Count how many imported amounts fail to convert, for a row that the import team must fix:

```dax
Failed Amounts =
CALCULATE(
    COUNTROWS(Imports),
    FILTER(
        Imports,
        ISERROR(VALUE(Imports[AmountText]))
    )
)
```

The count is a diagnostic. It shows how much of the import is unusable, and the same test can be placed in a calculated column to list the rows.

## Things to watch
- ISERROR is for diagnosis. In a report, IFERROR is the usual choice for the fallback value.
- Blank and zero are not errors. In DAX, the slash operator does not raise an error on division by zero, so ISERROR will not flag it. Use DIVIDE for ratios and test them with its result.
- ISERROR of a valid expression is FALSE, so it is safe to use for a flag column.
- Errors are rare in measures written with DIVIDE. If ISERROR returns TRUE often, look at the source data first.
- Do not hide the test inside a total. Count the flagged rows where the reader can see them.

## In business terms
ISERROR is the diagnostic test that a finance modeler uses to find broken data before a number is published. It turns a silent failure into a count the reviewer can act on. Hiding errors with a fallback without counting them is a common audit finding.
