A
C
- CALCULATE
- CALCULATETABLE
- CALENDAR
- CALENDARAUTO
- CEILING
- CHISQ.DIST
- CHISQ.DIST.RT
- CHISQ.INV
- CHISQ.INV.RT
- CLOSINGBALANCEMONTH
- CLOSINGBALANCEQUARTER
- CLOSINGBALANCEYEAR
- COALESCE
- COLUMNSTATISTICS
- COMBIN
- COMBINA
- COMBINEVALUES
- CONCATENATE
- CONCATENATEX
- CONFIDENCE.NORM
- CONFIDENCE.T
- CONTAINS
- CONTAINSROW
- CONTAINSSTRING
- CONTAINSSTRINGEXACT
- CONVERT
- COS
- COSH
- COT
- COTH
- COUNT
- COUNTA
- COUNTAX
- COUNTBLANK
- COUNTROWS
- COUNTX
- COUPDAYBS
- COUPDAYS
- COUPDAYSNC
- COUPNCD
- COUPNUM
- COUPPCD
- CROSSFILTER
- CROSSJOIN
- CUMIPMT
- CUMPRINC
- CURRENCY
- CURRENTGROUP
- CUSTOMDATA
D
E
I
N
O
P
R
S
- SAMEPERIODLASTYEAR
- SAMPLE
- SEARCH
- SECOND
- SELECTCOLUMNS
- SELECTEDMEASURE
- SELECTEDMEASUREFORMATSTRING
- SELECTEDMEASURENAME
- SELECTEDVALUE
- SIGN
- SIN
- SINH
- SLN
- SQRT
- SQRTPI
- STARTOFMONTH
- STARTOFQUARTER
- STARTOFYEAR
- STDEVX.P
- STDEVX.S
- STDEV.P
- STDEV.S
- SUBSTITUTE
- SUBSTITUTEWITHINDEX
- SUM
- SUMMARIZE
- SUMMARIZECOLUMNS
- SUMX
- SWITCH
- SYD
T
U
What is the ISERROR Function?
The ISERROR function is a DAX function that checks whether an expression returns an error. It returns a boolean value of TRUE if the expression returns an error, and FALSE if it does not. The syntax for the ISERROR function is as follows:
ISERROR(❰expression❱)
How to Use the ISERROR Function?
The ISERROR function can be used in a variety of ways to handle errors in your Power BI data. Here are some examples:
Example 1: Checking for Errors in a Calculation
Suppose you have a calculation that divides one column by another, but some of the values in the denominator column are zero. This will result in a division by zero error. To check for this error, you can use the ISERROR function in conjunction with the DIVIDE function, as follows:
IF(
ISERROR(DIVIDE(❰numerator❱, ❰denominator❱)),
BLANK(),
DIVIDE(❰numerator❱, ❰denominator❱)
)
This formula checks whether the DIVIDE function returns an error, and if so, returns a blank value. If the DIVIDE function does not return an error, it returns the result of the calculation.
Example 2: Handling Missing Data
Sometimes your data may have missing values, which can cause errors in your calculations. To handle this, you can use the ISERROR function in conjunction with the IF function to replace missing values with a default value. For example:
IF(
ISERROR(❰column❱),
❰default value❱,
❰column❱
)
This formula checks whether the column contains an error, and if so, replaces the error with a default value. If the column does not contain an error, it returns the original value.
Example 3: Filtering Out Errors
If you have a table that contains errors, you may want to filter them out to avoid displaying incorrect data. To do this, you can use the FILTER function in conjunction with the ISERROR function, as follows:
FILTER(
❰table❱,
NOT(ISERROR(❰column❱))
)
This formula filters out any rows in the table where the specified column contains an error.
The ISERROR function is a powerful tool for handling errors in your Power BI data. By using this function in conjunction with other DAX functions, you can check for errors, handle missing data, and filter out errors to ensure that your data is accurate and reliable.