ISERROR
Whether an expression gives an error (an infinite number counts as one).
Group: Logical. Compatible with DAX.
Syntax
ISERROR ( <value> )
| Parameter | Type | Description |
|---|---|---|
value | Value | The expression to test. |
Returns
Boolean. TRUE when the expression fails, FALSE when it gives a value.
Remarks
- Infinity and NaN, from a division by zero, count as errors.
- A blank is a value, not an error; so is the blank
DIVIDEgives for a division by zero. IF ( ISERROR ( x ), y, x )isIFERROR ( x, y )written out.
Examples
What counts as an error
EVALUATE
ROW (
"1 / 0", ISERROR ( 1 / 0 ),
"DIVIDE ( 1, 0 )", ISERROR ( DIVIDE ( 1, 0 ) ),
"Text as a number", ISERROR ( VALUE ( "abc" ) ),
"Blank", ISERROR ( BLANK () )
)
| 1 / 0 | DIVIDE ( 1, 0 ) | Text as a number | Blank |
|---|---|---|---|
| TRUE | FALSE | TRUE | FALSE |
Codes that are not numbers
EVALUATE
VAR Codes = DATATABLE ( "Code", STRING, { { "12" }, { "40" }, { "n/a" } } )
RETURN
ADDCOLUMNS ( Codes, "Not a number", ISERROR ( VALUE ( [Code] ) ) )
| Code | Not a number |
|---|---|
| 12 | FALSE |
| 40 | FALSE |
| n/a | TRUE |