<?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: Create a new column that calculates a running total for each unique ID in another column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-new-column-that-calculates-a-running-total-for-each/m-p/865426#M7052</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Running Total =
VAR _curDate = myTable[Date]
VAR _calc =
    CALCULATE (
        SUM ( myTable[Bill] ),
        FILTER ( ALLEXCEPT ( myTable, myTable[ID] ), MAX ( myTable[Date] ) &amp;lt;= _curDate )
    )
RETURN
    IF ( ISBLANK ( _calc ), myTable[Bill], _calc )&lt;/LI-CODE&gt;&lt;P&gt;Using variables in your DAX rather than Earlier is recommended now.&amp;nbsp;&lt;BR /&gt;Let me know if you have any questions.&lt;BR /&gt;&lt;BR /&gt;If this solves your issues, please mark it as the &lt;STRONG&gt;solution, &lt;/STRONG&gt;so that others can find it easily. &lt;STRONG&gt;Kudos &lt;/STRONG&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;are nice too.&lt;BR /&gt;Nathaniel&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Dec 2019 19:00:45 GMT</pubDate>
    <dc:creator>Nathaniel_C</dc:creator>
    <dc:date>2019-12-04T19:00:45Z</dc:date>
    <item>
      <title>Create a new column that calculates a running total for each unique ID in another column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-new-column-that-calculates-a-running-total-for-each/m-p/865344#M7051</link>
      <description>&lt;P&gt;I am having an issue creating a new column that calculates a running total for each unique ID listed. For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; Bill &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; Date &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; Running Total (this is what I need)&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 105 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1/1/19 &amp;nbsp; &amp;nbsp; &amp;nbsp; 105&lt;/P&gt;&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 103 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1/1/19 &amp;nbsp; &amp;nbsp; &amp;nbsp; 103&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 110 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2/1/19 &amp;nbsp; &amp;nbsp; &amp;nbsp; 215&lt;/P&gt;&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 98 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2/1/19 &amp;nbsp; &amp;nbsp; &amp;nbsp; 201&lt;/P&gt;&lt;P&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 132 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2/1/19 &amp;nbsp; &amp;nbsp; &amp;nbsp; 132&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, I have sucessfully created a measure that calculates the running total, but I am having difficulty figuring out the right filter, or group.... to use. Here is what I have so far.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Total = CALCULATE(
            SUM('Table1'[Bill]), 
            FILTER('Table1', 'Table1'[Date] &amp;lt;= EARLIER('Table1'[Date]))
        )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This calculation works and creates a valid result. However, it is the sum for all the Id's listed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My main issue, is my Id field is not distinct, because each Id has a monthly entry, it appears numerous times. My goal is to create a column that shows the sum of the current bill and all previous bills for each Id.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any assistance would be much appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 17:39:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-new-column-that-calculates-a-running-total-for-each/m-p/865344#M7051</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-04T17:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new column that calculates a running total for each unique ID in another column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-new-column-that-calculates-a-running-total-for-each/m-p/865426#M7052</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Running Total =
VAR _curDate = myTable[Date]
VAR _calc =
    CALCULATE (
        SUM ( myTable[Bill] ),
        FILTER ( ALLEXCEPT ( myTable, myTable[ID] ), MAX ( myTable[Date] ) &amp;lt;= _curDate )
    )
RETURN
    IF ( ISBLANK ( _calc ), myTable[Bill], _calc )&lt;/LI-CODE&gt;&lt;P&gt;Using variables in your DAX rather than Earlier is recommended now.&amp;nbsp;&lt;BR /&gt;Let me know if you have any questions.&lt;BR /&gt;&lt;BR /&gt;If this solves your issues, please mark it as the &lt;STRONG&gt;solution, &lt;/STRONG&gt;so that others can find it easily. &lt;STRONG&gt;Kudos &lt;/STRONG&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;are nice too.&lt;BR /&gt;Nathaniel&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 19:00:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-new-column-that-calculates-a-running-total-for-each/m-p/865426#M7052</guid>
      <dc:creator>Nathaniel_C</dc:creator>
      <dc:date>2019-12-04T19:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new column that calculates a running total for each unique ID in another column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-new-column-that-calculates-a-running-total-for-each/m-p/865482#M7054</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;Or this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Running Total 2 = 
Var _curDate = myTable[Date]
Var _curID = myTable[ID]
var _calc = CALCULATE(SUM(myTable[Bill]),myTable[Date]&amp;lt;=_curDate,myTable[ID]=_curID, All(mytable))
return _calc&lt;/LI-CODE&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Let me know if you have any questions.&lt;BR /&gt;&lt;BR /&gt;If this solves your issues, please mark it as the &lt;STRONG&gt;solution, &lt;/STRONG&gt;so that others can find it easily. &lt;STRONG&gt;Kudos &lt;/STRONG&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;are nice too.&lt;BR /&gt;Nathaniel&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 20:03:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-new-column-that-calculates-a-running-total-for-each/m-p/865482#M7054</guid>
      <dc:creator>Nathaniel_C</dc:creator>
      <dc:date>2019-12-04T20:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new column that calculates a running total for each unique ID in another column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-new-column-that-calculates-a-running-total-for-each/m-p/869829#M7156</link>
      <description>&lt;P&gt;Thanks for the assistance! I ended up using the second solution you posted. It is correctly calculating the running total bill for each account ID in my data as I intended. Awesome job!&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 16:42:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-new-column-that-calculates-a-running-total-for-each/m-p/869829#M7156</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-09T16:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new column that calculates a running total for each unique ID in another column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-new-column-that-calculates-a-running-total-for-each/m-p/869858#M7157</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;BR /&gt;You are welcome!&lt;BR /&gt;&lt;BR /&gt;Nathaniel&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 17:09:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-new-column-that-calculates-a-running-total-for-each/m-p/869858#M7157</guid>
      <dc:creator>Nathaniel_C</dc:creator>
      <dc:date>2019-12-09T17:09:18Z</dc:date>
    </item>
  </channel>
</rss>

