Safe Divide function for DAX and MDX

With SQL Server 2012 SP1 and Office 2013 the DAX language is extended with a new safe Divide function, I wont cover it in too much detail as Rob covered it quiet extensively here:

In short the main reason you want to use this function is for performance (and some usability). This Divide function can handle empty values on the denominator much better than any other implementation you could do manually and can skip the internal error handling that is needed making it much faster.

For those of you who haven’t found it yet this function is also implemented into MDX. You need to install SQL Server 2012 SP1  for this to show up.

I would recommend using this function when you are doing any divides in either DAX or MDX.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.