Search
 Coin Explorers
Search
 Coin Explorers

Portfolio

Markets

Project Reviews

Founder Stories

Features

Guides

News

Videos

Let’s stay in touch:

News

DAX DIVIDE for Excels Power Pivot, Power BI and Analysis Services — Steemit

The Divide Problem  When you are working in Excel it is relatively easy to divide two numbers. You take the value… by paulag

Jul 14, 2017 · 3 min read
  • Share on X
  • Share on Facebook
  • Share on Linkedin
DAX DIVIDE for Excels Power Pivot, Power BI and Analysis Services — Steemit

The Divide Problem  When you are working in Excel it is relatively easy to divide two numbers. You take the value from one cell, and divide it by the value in another cell.  For Example =B3/B2.  Divide is a basic mathematical operator. In Excel if you try to divide a value by zero you will get the error # DIV/0! Power BI and Power Pivot don’t work on cell references like Excel.  They both work on columns of data.  It is very common to add a calculated column using divide. A perfect example would be on a sales table to take the profit column and divide it by sales column to get the gross profit %. Using the mathematical divide in Power BI or Power Pivot can lead to a problem if your table of data contains a 0. You will not be returned an error. Instead you will be returned with the symbol for infinite ∞.  It is also common for people not to spot this problem.  This is because when you are working with data in Power BI or Power Pivot, only a subset of data is visible.  It is very possible that zeros are further down your data set and you have not seen them. The DIVIDE Solution So how can you overcome this problem in Power BI or Power Pivot? DAX is to the rescue with the DIVIDE function.  The syntax is simple =DIVIDE(Numerator, Denominator, [AlternateResult]) Let’s have a look at both the DIVIDE function and the divide operator in action. We have a table of data containing columns for Date, Invoice number, Product, Units sold, Total sales and total cost price. What we want to do is calculate the Gross profit %.   First we will set up a new calculated column. This column will contain the expression = [Total Sales Price] – [Total Cost Price] This will return the gross profit for each row in the table.  We can rename this column Profit.    To get the Gross Profit % we now need to divide the Profit by the Sales.  Let’s do this two ways to see the difference.  First we will look at the mathematical operator divide and then we will look at the DAX function DIVIDE(). In a new calculated column we will enter the expression = [Profit] / [Total Sales Price]    If you look down the table you will find two invoices where the sales price is zero.   And look what’s happened with the calculated column for these rows.  The value returned is not error but instead ∞. To overcome this we can use DAX DIVIDE function.  Let’s now add a new calculated column and this time our expression will be =DIVIDE([Profit], [Total Sales Price]) In this example we have not added the [AlternateResult] as this is optional.  By default the alternate result will be blank. If we now edit this expression to read =DIVIDE([Profit], [Total Sales Price],0) This will now replace the blank with 0.  So my advice, well it’s better to be safe than sorry right.  Always use the DAX DIVIDE function when you need to divide values. Watch an example by video:


  • Share on X
  • Share on Facebook
  • Share on Linkedin

Related News

Bitcoin has officially entered the Guinness World Records for a number of entries, the first of which is being recognized as the First Decentralized Cryptocurrency
News

Bitcoin has officially entered the Guinness World Records for a number of entries, the first of which is being recognized as the First Decentralized Cryptocurrency

Bitcoin now has multiple entries in the Guinness Book of World Records, including most valuable and the first decentralized cryptocurrency.

Oct 19, 2022

740 Million in Bitcoin exits exchanges, the biggest outflow since June's BTC price crash
News

740 Million in Bitcoin exits exchanges, the biggest outflow since June's BTC price crash

The technical outlook, however, remains bearish for Bitcoin, with the price eyeing a run-down toward $14,000 in Q4/2022.

Oct 18, 2022

Bitcoin Wins the Guinness World Record for First Decentralized Cryptocurrency
News

Bitcoin Wins the Guinness World Record for First Decentralized Cryptocurrency

Bitcoin has been honored as the oldest and most valuable crypto, while El Salvador is recognized as the first country to adopt it as legal tender. 

Oct 18, 2022

 Coin Explorers

PortfolioMarketsProject ReviewsFounder StoriesFeaturesGuidesNewsVideosTerms & ConditionsPrivacy Policy

Powered by

 Coin Explorers

Copyright © 2025 - All Rights Reserved