ERROR Function (DAX)

How does the ERROR function (DAX) work?

The ERROR function (DAX) raises an error with an error message.

ERROR Formula Syntax

ERROR(
     <text>
)

How do you use the ERROR function?

The ERROR function can be used to stop the execution of the calculation. 

Related Blog Posts

Related Support Forum Posts

Format Causing Errors
OLE DB or ODBC – Data format error
Error Message – Base Version Must Not be Negative

Considerations when using the ERROR function

If Excel detects that your Excel Formula or Function contains an error, it will return an error message (e.g. #VALUE!, #N/A).

The error message that you are presented with, provides information about the type and cause of the Excel formula error. It can therefore assist you with identifying and fixing the problem.

Related Video Tutorials

Formula examples using the ERROR function

MEASURE DimProduct[Measure] = IF( SELECTEDVALUE(DimProduct[Color]) = “Red”, ERROR(“red color encountered”), SELECTEDVALUE(DimProduct[Color]) )

= IF( SELECTEDVALUE(DimProduct[Color]) = “Magenta”, ERROR(“magenta color encountered”), SELECTEDVALUE(DimProduct[Color]) )

=ERROR.TYPE(B3)

Related Course Modules

Ultimate-Beginners-Guide-To-PowerBI

DOWNLOAD

To access our comprehensive DAX formula reference guide just insert your email address below. The resource will download immediately and we’ll also email it to you.