Please note javascript is required for full website functionality.

Blog

Power Pivot Principles: The A to Z of DAX Functions – DIVIDE

6 June 2023

In our long-established Power Pivot Principles articles, we continue our series on the A to Z of Data Analysis eXpression (DAX) functions.  This week, we look at DIVIDE

 

The DIVIDE function

The DIVIDE function is one of the mathematical and trigonometric functions.  It performs a division and returns the result or BLANK() on division by zero (#DIV/0!).  It has the following syntax:

DIVIDE (numerator, denominator, alternate_result)

It has three [3] arguments in the syntax:

  • numerator: this is required, and it represents the number to divide (i.e. the numerator)
  • denominator: this is required, and it represents the number to divide by (i.e. the denominator)
  • alternate_result: this is optional, and it represents the value returned when division by zero results in an error.  If this argument is not stated, it will be set to a BLANK value as a default.

Here are a few remarks about this function:

  • the alternative_result on divide by zero (#DIV/0!) must be a constant
  • the DIVIDE function is faster than an IF statement checking whether the denominator is zero [0], but the DIVIDE function is executed in the formula engine, and therefore it is not as fast as a native division.

Here are two simple examples of this function:

This will return:

Now let’s see the effect of dividing by zero [0]:

Which will return the string: “Infinity” as we specified in the alternate_result argument.

Come back next week for our next post on Power Pivot in the Blog section.  In the meantime, please remember we have training in Power Pivot which you can find out more about here.  If you wish to catch up on past articles in the meantime, you can find all of our Past Power Pivot blogs here.

Newsletter