<?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: cumulative sum or count in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/cumulative-sum-or-count/m-p/2722206#M83062</link>
    <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="418662" data-lia-user-login="MasterSonic" class="lia-mention lia-mention-user"&gt;MasterSonic&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You can try modifying the function to the following form:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;cumulative = 
var AB = SUM('Col2'[Column])
return
CALCULATE(
SUM(
'Col1'[10]),
FILTER(
ALLSELECTED('Col2'[Date]),
'Col2'[Date]&amp;lt;= MAX('Col2'[Date])&amp;amp;&amp;amp;
'Col2'[Date]&amp;lt;&amp;gt;BLANK()
))
&lt;/LI-CODE&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
    <pubDate>Wed, 24 Aug 2022 06:39:30 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-08-24T06:39:30Z</dc:date>
    <item>
      <title>cumulative sum or count</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/cumulative-sum-or-count/m-p/2685817#M80660</link>
      <description>&lt;P&gt;Hi guys,&lt;BR /&gt;&lt;BR /&gt;I have 2 tables -&lt;/P&gt;&lt;P&gt;first with uniqe codes&lt;/P&gt;&lt;P&gt;second with dates and category (A,B,C)&lt;/P&gt;&lt;P&gt;I have created this :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Count of dates = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;sum&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Col1'[code]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Col2'[Date]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;ISONORAFTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Col2'[Date]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Col2'[Date]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;DESC&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I am happy with results as next screenshot shows&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But after appling filter on category - I have this Count 1 values.&lt;BR /&gt;Should not this single values add up to the rest?&lt;/P&gt;&lt;P&gt;Can you help me with that please ?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Aug 2022 22:06:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/cumulative-sum-or-count/m-p/2685817#M80660</guid>
      <dc:creator>MasterSonic</dc:creator>
      <dc:date>2022-08-07T22:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: cumulative sum or count</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/cumulative-sum-or-count/m-p/2686063#M80681</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="418662" data-lia-user-login="MasterSonic" class="lia-mention lia-mention-user"&gt;MasterSonic&lt;/a&gt; , You should always use a separate date table(Joined with date of your table) for that. and in visual use columns from that date table &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Count of dates =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;sum('Col1'[code]),&lt;BR /&gt;FILTER(&lt;BR /&gt;ALLSELECTED('Date'[Date]),&lt;BR /&gt;ISONORAFTER('Date'[Date],MAX('Date'[Date]), DESC)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Running Total/ Cumulative: &lt;A href="https://www.youtube.com/watch?v=h2wsO332LUo&amp;amp;list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&amp;amp;index=41" target="_blank"&gt;https://www.youtube.com/watch?v=h2wsO332LUo&amp;amp;list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&amp;amp;index=41&lt;/A&gt;&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 03:15:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/cumulative-sum-or-count/m-p/2686063#M80681</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-08-08T03:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: cumulative sum or count</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/cumulative-sum-or-count/m-p/2687090#M80758</link>
      <description>&lt;P&gt;Hi&amp;nbsp;amitchadak,&lt;BR /&gt;&lt;BR /&gt;I have added new table&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Date = &lt;/SPAN&gt;&lt;SPAN&gt;CALENDAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;2015&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;01&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;01&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;DATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;2030&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;12&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;31&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;And applied your code (&lt;/P&gt;&lt;P&gt;instead of sum I have used count tho, column code has also strings within so sum doesn't work)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- it works&amp;nbsp; but I would like to see smooth rise of overal values&lt;BR /&gt;What currenlty I have as a table view are values on the left.&lt;BR /&gt;My main goal is to set values like this screenshot from excel in yellow/right.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 10:59:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/cumulative-sum-or-count/m-p/2687090#M80758</guid>
      <dc:creator>MasterSonic</dc:creator>
      <dc:date>2022-08-08T10:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: cumulative sum or count</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/cumulative-sum-or-count/m-p/2687856#M80828</link>
      <description>&lt;P&gt;I got this one so it works per category.&lt;span class="lia-unicode-emoji" title=":cowboy_hat_face:"&gt;🤠&lt;/span&gt;&lt;BR /&gt;I think I cannot use filter on visual level, so needed to do this.&lt;BR /&gt;Also I referred to dates within my table not to Date table I created previously.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Column = CALCULATE(DISTINCTCOUNT(‘Col1'[code]))&lt;/P&gt;&lt;P&gt;/&lt;BR /&gt;10 = CALCULATE(SUM('Col1'[Column]),'Col1'[Category]="C")&lt;/P&gt;&lt;P&gt;/&lt;/P&gt;&lt;P&gt;cumulative =&lt;/P&gt;&lt;P&gt;var AB = SUM(‘Col1’ [Column])&lt;/P&gt;&lt;P&gt;return&lt;/P&gt;&lt;P&gt;CALCULATE(&lt;/P&gt;&lt;P&gt;'Col1'[10],&lt;/P&gt;&lt;P&gt;FILTER(&lt;/P&gt;&lt;P&gt;ALLSELECTED('Col2'[Date]),&lt;/P&gt;&lt;P&gt;'Col2'[Date]&amp;lt;= MAX('Col2'[Date]]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;))&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/&lt;/P&gt;&lt;P&gt;Could you just tell me how to do not count blanks from Col2[Date] please?&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;</description>
      <pubDate>Mon, 08 Aug 2022 16:16:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/cumulative-sum-or-count/m-p/2687856#M80828</guid>
      <dc:creator>MasterSonic</dc:creator>
      <dc:date>2022-08-08T16:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: cumulative sum or count</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/cumulative-sum-or-count/m-p/2691688#M81078</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="418662" data-lia-user-login="MasterSonic" class="lia-mention lia-mention-user"&gt;MasterSonic&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Add this to the filter condition:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;amp;&amp;amp;'Col2'[Date]&amp;lt;&amp;gt; blank()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Jay&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 07:54:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/cumulative-sum-or-count/m-p/2691688#M81078</guid>
      <dc:creator>hircinelol</dc:creator>
      <dc:date>2022-08-10T07:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: cumulative sum or count</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/cumulative-sum-or-count/m-p/2722206#M83062</link>
      <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="418662" data-lia-user-login="MasterSonic" class="lia-mention lia-mention-user"&gt;MasterSonic&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You can try modifying the function to the following form:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;cumulative = 
var AB = SUM('Col2'[Column])
return
CALCULATE(
SUM(
'Col1'[10]),
FILTER(
ALLSELECTED('Col2'[Date]),
'Col2'[Date]&amp;lt;= MAX('Col2'[Date])&amp;amp;&amp;amp;
'Col2'[Date]&amp;lt;&amp;gt;BLANK()
))
&lt;/LI-CODE&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 06:39:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/cumulative-sum-or-count/m-p/2722206#M83062</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-24T06:39:30Z</dc:date>
    </item>
  </channel>
</rss>

