<?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: Sum of calculation up til x month including previous months in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-calculation-up-til-x-month-including-previous-months/m-p/3394949#M128052</link>
    <description>&lt;P&gt;Not just within the current month, but I'm looking to have the total of all balances that carryover at the end of each month.&lt;BR /&gt;&lt;BR /&gt;Ex:&lt;BR /&gt;&lt;BR /&gt;month 1: +300$ -200$&lt;/P&gt;&lt;P&gt;Month 2: +400$ -100$&lt;/P&gt;&lt;P&gt;Month 3: +100$-130$&lt;/P&gt;&lt;P&gt;Month 4: +230$ -100$&lt;/P&gt;&lt;P&gt;Month 5: +300$ - 250$&lt;/P&gt;&lt;P&gt;Month 6: +100$ - 200$&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want the results to be&lt;/P&gt;&lt;P&gt;Month 1: 100$&lt;/P&gt;&lt;P&gt;Month 2: 400$&lt;BR /&gt;Month 3: 370$&lt;/P&gt;&lt;P&gt;Month 4: 500$&lt;/P&gt;&lt;P&gt;Month 5: 550$&lt;/P&gt;&lt;P&gt;Month 6: 450$&lt;/P&gt;</description>
    <pubDate>Wed, 23 Aug 2023 13:49:28 GMT</pubDate>
    <dc:creator>sdelpo</dc:creator>
    <dc:date>2023-08-23T13:49:28Z</dc:date>
    <item>
      <title>Sum of calculation up til x month including previous months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-calculation-up-til-x-month-including-previous-months/m-p/3390504#M127821</link>
      <description>&lt;P&gt;I am trying to do a rolling total of data. I got to this dax command but that only give me the total of the current balance from today. I want to be able to see the total ending balance of each month to compare this month's total to previous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/DIV&gt;</description>
      <pubDate>Mon, 21 Aug 2023 14:58:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-calculation-up-til-x-month-including-previous-months/m-p/3390504#M127821</guid>
      <dc:creator>sdelpo</dc:creator>
      <dc:date>2023-08-21T14:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of calculation up til x month including previous months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-calculation-up-til-x-month-including-previous-months/m-p/3393646#M127985</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="605951" data-lia-user-login="sdelpo" class="lia-mention lia-mention-user"&gt;sdelpo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you want to calculate the total of each month?&lt;/P&gt;
&lt;P&gt;If you want to achieve this goal, you can modify the measure to the following&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Balance =
VAR Maxdate =
    MAX ( ExtractReport[InvoiceServiceDate (bins)] )
RETURN
    CALCULATE (
        SUM ( ExtractReport[Charge] ) + SUM ( ExtractReport[Tax] )
            - SUM ( ExtractReport[WA] )
            - SUM ( ExtractReport[AA] )
            - SUM ( ExtractReport[Adjust] )
            - SUM ( ExtractReport[WriteOff] )
            - SUM ( ExtractReport[Refund] )
            - SUM ( ExtractReport[SCRefund] )
            - SUM ( ExtractReport[SCPayment] )
            - SUM ( ExtractReport[AppliedPayment] )
            - SUM ( ExtractReport[Payment] )
    )
&lt;/LI-CODE&gt;
&lt;P&gt;If this cannot meet your requirement, can you provide some sample data and the output you want?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards!&lt;/P&gt;
&lt;P&gt;Yolo Zhu&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;I&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/I&gt;, then please consider&amp;nbsp;&lt;I&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/I&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2023 02:16:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-calculation-up-til-x-month-including-previous-months/m-p/3393646#M127985</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-23T02:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of calculation up til x month including previous months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-calculation-up-til-x-month-including-previous-months/m-p/3394949#M128052</link>
      <description>&lt;P&gt;Not just within the current month, but I'm looking to have the total of all balances that carryover at the end of each month.&lt;BR /&gt;&lt;BR /&gt;Ex:&lt;BR /&gt;&lt;BR /&gt;month 1: +300$ -200$&lt;/P&gt;&lt;P&gt;Month 2: +400$ -100$&lt;/P&gt;&lt;P&gt;Month 3: +100$-130$&lt;/P&gt;&lt;P&gt;Month 4: +230$ -100$&lt;/P&gt;&lt;P&gt;Month 5: +300$ - 250$&lt;/P&gt;&lt;P&gt;Month 6: +100$ - 200$&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want the results to be&lt;/P&gt;&lt;P&gt;Month 1: 100$&lt;/P&gt;&lt;P&gt;Month 2: 400$&lt;BR /&gt;Month 3: 370$&lt;/P&gt;&lt;P&gt;Month 4: 500$&lt;/P&gt;&lt;P&gt;Month 5: 550$&lt;/P&gt;&lt;P&gt;Month 6: 450$&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2023 13:49:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-calculation-up-til-x-month-including-previous-months/m-p/3394949#M128052</guid>
      <dc:creator>sdelpo</dc:creator>
      <dc:date>2023-08-23T13:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of calculation up til x month including previous months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-calculation-up-til-x-month-including-previous-months/m-p/3396514#M128122</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="605951" data-lia-user-login="sdelpo" class="lia-mention lia-mention-user"&gt;sdelpo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try the following code&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Balance = VAR Maxdate = MAX(ExtractReport[InvoiceServiceDate (bins)])

 

Return

 

CALCULATE(

 

SUM(ExtractReport[Charge])

 

+ SUM(ExtractReport[Tax])

 

- SUM(ExtractReport[WA])

 

- SUM(ExtractReport[AA])

 

- SUM(ExtractReport[Adjust])

 

- SUM(ExtractReport[WriteOff])

 

- SUM(ExtractReport[Refund])

 

- SUM(ExtractReport[SCRefund])

 

- SUM(ExtractReport[SCPayment])

 

- SUM(ExtractReport[AppliedPayment])

 

- SUM(ExtractReport[Payment]),

FILTER(ALL(ExtractReport),ExtractReport[InvoiceServiceDate (bins)] &amp;lt;= Maxdate))

 &lt;/LI-CODE&gt;
&lt;P&gt;And can you provide some sample data, based on the information you have offered, the dax your wrote is right. the picture you offered cannot see the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards!&lt;/P&gt;
&lt;P&gt;Yolo Zhu&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 08:08:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-calculation-up-til-x-month-including-previous-months/m-p/3396514#M128122</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-24T08:08:06Z</dc:date>
    </item>
  </channel>
</rss>

