<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Trying to calculate a running total column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-a-running-total-column/m-p/1851188#M39552</link>
    <description>&lt;P&gt;This worked like a charm, thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 May 2021 11:05:17 GMT</pubDate>
    <dc:creator>steamexpert</dc:creator>
    <dc:date>2021-05-19T11:05:17Z</dc:date>
    <item>
      <title>Trying to calculate a running total column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-a-running-total-column/m-p/1849748#M39515</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to calculate the running total for a table that has two columns Capacity input and Dummy Capacity. The total for the row should be Capacity input - dummy capacity. Example: line 1 in the table below should be 13 - 21 = -8.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Capacity input is the count of line items for each bin and Dummy Capacity is the average capacity per bin (this number can be hardcoded if it's going to make the calculation easier).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I looked around for a few ideas on how to write a DAX that could work, but I haven't been successful so far (you can see the output in the table below).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the DAX:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;LI-CODE lang="markup"&gt;Running total = calculate(
sumx(
Project,
sum(Project[Capacity input])-AVERAGE(Project[Dummy Capacity])
),
filter(
ALLSELECTED(Project),
Project[End_Date__c]&amp;lt;=MAX(Project[End_Date__c])
)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The table below should give me:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Row 1 = 13 - 21 = -8&lt;/P&gt;&lt;P&gt;Row 2 = -8 +32 - 21 = +19&lt;/P&gt;&lt;P&gt;Row 3 = 19 + 32 -21 = +30&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for any help that you can provide.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Jose&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 May 2021 23:27:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-a-running-total-column/m-p/1849748#M39515</guid>
      <dc:creator>steamexpert</dc:creator>
      <dc:date>2021-05-18T23:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to calculate a running total column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-a-running-total-column/m-p/1850161#M39529</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="302804" data-lia-user-login="steamexpert" class="lia-mention lia-mention-user"&gt;steamexpert&lt;/a&gt; , Try with these changes &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Running total = calculate(&lt;BR /&gt;sumx(&lt;BR /&gt;values(Project[End_Date__c bins]),&lt;BR /&gt;calculate(um(Project[Capacity input])-AVERAGE(Project[Dummy Capacity]))&lt;BR /&gt;),&lt;BR /&gt;filter(&lt;BR /&gt;ALLSELECTED(Project),&lt;BR /&gt;Project[End_Date__c]&amp;lt;=MAX(Project[End_Date__c])&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 04:27:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-a-running-total-column/m-p/1850161#M39529</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-05-19T04:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to calculate a running total column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-a-running-total-column/m-p/1851188#M39552</link>
      <description>&lt;P&gt;This worked like a charm, thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 11:05:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-a-running-total-column/m-p/1851188#M39552</guid>
      <dc:creator>steamexpert</dc:creator>
      <dc:date>2021-05-19T11:05:17Z</dc:date>
    </item>
  </channel>
</rss>

