DIVIDE DAX Function (Math and Trig)

Safe Divide function with ability to handle divide by zero case.

Syntax

DIVIDE ( <Numerator>, <Denominator> [, <AlternateResult>] )
Parameter Attributes Description
Numerator

Numerator.

Denominator

Denominator.

AlternateResult Optional

Optional. The alternate result to return when dividing by zero.

Return values

Scalar A single decimal value.

Result of the division between Numerator and Denominator, or AlternateResult in case there is a division by zero.

Remarks

Alternate result on divide by 0 must be a constant.
DIVIDE is faster then an IF statement checking whether the denominator is zero. However, DIVIDE is executed in the formula engine and it is not as fast as a native division.

Related articles

Learn more about DIVIDE in the following articles:

  • DIVIDE Performance

    The DIVIDE function in DAX is usually faster to avoid division-by-zero errors than the simple division operator. However, there are exceptions to this rule, described in this article through a simple performance analysis. » Read more

Related functions

Other related functions are:

Last update: Oct 13, 2018   » Contribute   » Show contributors

Contributors: Alberto Ferrari, Marco Russo

MSDN documentation: https://msdn.microsoft.com/en-us/query-bi/dax/divide-function-dax

DAX Conventions
Context Transition

This function performs a Context Transition if called in a Row Context. Click to read more.

Row Context

This expression is executed in a Row Context. Click to read more.

Not recommended

The use of this function is not recommended. See Remarks and Related functions for alternatives.

Not recommended

The use of this parameter is not recommended.

Deprecated

This function is deprecated. Jump to the Alternatives section to see the function to use.

Deprecated

This parameter is deprecated and its use is not recommended.

Contribute

Want to improve the content of DIVIDE? Did you find any issue? Please, report it us!
All submissions will be evaluated for possible updates of the content.