<?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: Problem with cumulative(running) total in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-cumulative-running-total/m-p/3256048#M120249</link>
    <description>&lt;P&gt;Can you share your PBI?&lt;/P&gt;</description>
    <pubDate>Sat, 27 May 2023 00:00:58 GMT</pubDate>
    <dc:creator>raksone</dc:creator>
    <dc:date>2023-05-27T00:00:58Z</dc:date>
    <item>
      <title>Problem with cumulative(running) total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-cumulative-running-total/m-p/3255993#M120247</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to calculate a cumulative/running total using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Running Invoiced Amounts = 
VAR CurrentDate = MAX(AR_Balances[GL Date])
RETURN

CALCULATE(
    SUMX(AR_Balances, AR_Balances[Invoice Amount]),
    FILTER(
        ALL(AR_Balances),
        AR_Balances[GL Date] &amp;lt;= CurrentDate
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;Above gives matrix following output:&lt;/DIV&gt;&lt;DIV&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;GL Date*&lt;/TD&gt;&lt;TD&gt;Invoice Amount&lt;/TD&gt;&lt;TD&gt;Cumulative Total&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1-Jan-22&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;1,050&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;15-Jan-22&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;TD&gt;1,250&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;31-Dec-22&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;TD&gt;1,450&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1-Jan-23&lt;/TD&gt;&lt;TD&gt;250&lt;/TD&gt;&lt;TD&gt;1,700&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;27-May-23&lt;/TD&gt;&lt;TD&gt;300&lt;/TD&gt;&lt;TD&gt;2,200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Total&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;1,050&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;3,050&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;*GL Date = Invoice Date&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Problems I am unable to fix::&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;1. Starting of cumulative total (1,050) is the sum of all invoices (total). Why and how to prevent so?&lt;/P&gt;&lt;P&gt;2. Cumulative total seemingly works (if starting 1,050 is ignored), but I expect it to reset as soon as the year changes on 31-Dec. How to achieve this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 26 May 2023 21:37:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-cumulative-running-total/m-p/3255993#M120247</guid>
      <dc:creator>voidbydefault</dc:creator>
      <dc:date>2023-05-26T21:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with cumulative(running) total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-cumulative-running-total/m-p/3255999#M120248</link>
      <description>&lt;P&gt;Update:&lt;BR /&gt;I have managed to fix the first issue where cumulative total started with the sum of all invoices (i.e. 1,050) using below DAX. Please help me with the second problem. Thanks:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Solution to # 1:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Running Invoiced Amounts = 
VAR CurrentDate = MAX(AR_Balances[GL Date])
RETURN

CALCULATE(
    SUMX(AR_Balances, AR_Balances[Invoice Amount]),
    AR_Balances[GL Date] &amp;lt;= CurrentDate
)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 26 May 2023 21:48:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-cumulative-running-total/m-p/3255999#M120248</guid>
      <dc:creator>voidbydefault</dc:creator>
      <dc:date>2023-05-26T21:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with cumulative(running) total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-cumulative-running-total/m-p/3256048#M120249</link>
      <description>&lt;P&gt;Can you share your PBI?&lt;/P&gt;</description>
      <pubDate>Sat, 27 May 2023 00:00:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-cumulative-running-total/m-p/3256048#M120249</guid>
      <dc:creator>raksone</dc:creator>
      <dc:date>2023-05-27T00:00:58Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with cumulative(running) total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-cumulative-running-total/m-p/3256509#M120282</link>
      <description>&lt;P&gt;Nopes. Apologies.&lt;/P&gt;</description>
      <pubDate>Sat, 27 May 2023 21:32:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-cumulative-running-total/m-p/3256509#M120282</guid>
      <dc:creator>voidbydefault</dc:creator>
      <dc:date>2023-05-27T21:32:17Z</dc:date>
    </item>
  </channel>
</rss>

