ERROR

The ERROR function displays an error message.

Syntax

ERROR(
    text
)

Parameters
  • text: Text string containing the error message to display.
Returned value

The ERROR function does not return a value.

Additional Information

The ERROR function can be used as an argument to any DAX expression where a scalar is expected.

Examples

In this example, an error message is generated if the selected country is Canada, and the value of the Total sales measure is returned otherwise:

Country selected =
IF (
    SELECTEDVALUE(Geography[Country]) = "Canada",
    ERROR("No data available for Canada"),
    [Total sales]
)

Category
Other functions
Submitted by admin on Wed, 01/16/2019 - 13:15