Neal Waterstreet

  • Home
  • About
  • Book Reviews
    • 2018 Reading List
    • 2017 Reading List
    • 2016 Reading List
    • 2015 Reading List
    • 2014 Reading List
    • 2013 Reading List
  • Projects
    • OBi200
    • DS716+ memory upgrade
    • Cord cutting
  • Presentations
  • Contact

Archives for June 25, 2013

DAX: Divide By Zero Error

June 25, 2013 by neal Leave a Comment

Like most languages, you will probably run into the divide by zero issue at some point with DAX. I checked around and saw some different solutions people are using. The best example I found was this pattern by Kasper de Jonge.

IF([Measure 2] <> 0, [Measure 1] / [Measure 2], 0).

I also looked at the DIVIDE() function for DAX on MSDN. It has the following syntax:

DIVIDE(numerator, denominator [,alternateresult])

Much less code than before!

I ran a very informal test with 1M rows to compare the two. There doesn’t appear to be any difference in performance based on my test, however I should do it again using more data. I checked into it a little more and noticed that both appear to throw the same errors. For instance, when the numerator or denominator is text both methods result in an error.

Has anyone else come across this? There is not too much information out there about error checking in DAX.

Filed Under: SSAS Tagged With: DAX, Error Messages, Power Pivot

June 2013
M T W T F S S
 12
3456789
10111213141516
17181920212223
24252627282930
« May   Jul »

Blogroll

  • Atlanta MDF
  • Atlanta Microsoft Business Intelligence Group
  • Atlanta Modern Excel User Group
  • Chris Webb's BI Blog
  • codegumbo
  • Lance England
  • PowerPivotPro
  • Prologika
  • SQLBI

Tags

#SQLSatATLBI Aereo at Atlanta Microsoft BI Azure Azure DataFest Backups Batch Certification changeset Chicago Conference CrashPlan Data Modeling Data Quality DAX Deployment DVR Entity-based staging Error Messages Excel Filter Goals Headphones Healthcare Leaf Tables MDM MDS MDS Add-in for Excel Oops! Something went wrong PASS Healthcare VC Power BI Power Pivot review Roku SQLSaturday SQL Saturday 800 SQLSaturday Atlanta BI SSIS Streaming Subscription View Time Training Validation Version Flag

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Copyright © 2023 · Minimum Pro Theme on Genesis Framework · WordPress · Log in