title: How to divide each row of a calculated column by the total of another calculated column?
body: <p>I can't get a division correct with this sample data:</p>
  
  <pre><code>Calculated column    Another calc. column
     48                  207
    257                  370
    518                  138
    489                  354
    837                  478
  1,005                  648
  1,021                2,060
  1,463                2,164
  2,630                1,818
  2,993                2,358
  3,354                3,633
  4,332                5,234
  4,885                6,108
  4,514                6,008
  4,356                6,888
  4,824                7,382
  7,082                5,988
  7,498                6,059
                       4,865
                       4,192
                       3,816
                       2,851
                       2,768
                       2,093
                       2,207
                         770
                         397
                         149
                         178
                         336
                         167
                         124
                          18
  </code></pre>
  
  <p>What I'm trying to do is to create a new calculated column.</p>
  
  <p>For each row I want to get the value of <code>Calculated column</code> and divide it by the Total of <code>Another calc. column</code>.</p>
  
  <p>The Total of <code>Another calc. column</code> = 82826</p>
  
  <p>This is the desired output in a brand new calculated column, let's call it <code>% Column</code>:</p>
  
  <pre><code>% Column
  
  0,000579528167484
  0,003102890396735
  0,006254074807428
  .
  .
  .
  </code></pre>
  
  <blockquote>
    <p><strong>NOTE</strong> - these 3 columns: <code>Calculated column</code>, <code>Another calc. column</code> and <code>% Column</code> are all in the same table and are all <strong>calculated columns</strong>.</p>
  </blockquote>
  
  <p>I tried lots of formulas but not a single one returned the desired output. :| I guess it's because of the nature of calculated columns or I'm not getting the gist of it.</p>
  
  <p>Is this even possible or I should follow another path using a Measure?</p>
  
  <p>Can you shed some light?</p>
  
  <p><strong>####### EDIT #######</strong></p>
  
  <p>I put together a sample file to help debugging this. Here it is:
  <a href="https://drive.google.com/open?id=1r7kiIkwgHnI5GUssJ6KlXBAoeDRISEuC" rel="nofollow noreferrer">https://drive.google.com/open?id=1r7kiIkwgHnI5GUssJ6KlXBAoeDRISEuC</a></p>
  
  <p>As you see:</p>
  
  <ul>
  <li><code>Earned Daily % HARDCODED</code> works just fine because <code>82826</code> is hardcoded as the denominator.</li>
  <li><code>Earned Daily % by StelioK</code> and <code>Earned Daily % by Alexis Olson</code> output the same wrong value for the division when using <code>SUM</code> formula.</li>
  </ul>
  
  <p>I'm using the latest Power BI Desktop version if that matters: <code>Version: 2.70.5494.701 64-bit (June 2019)</code></p>
  
  <p><a href="https://i.stack.imgur.com/acpij.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/acpij.png" alt="enter image description here"></a></p>