<?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: Getting sum from cumulative table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-sum-from-cumulative-table/m-p/4139918#M164490</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I tried to create a sample pbix file like below, and please check the below picture and the attached pbix file.&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sales MTD: = 
VAR _t =
    FILTER (
        ADDCOLUMNS (
            ALL ( 'date'[date], 'date'[Year], 'date'[Month], 'date'[Day] ),
            "@sales", [Sales:]
        ),
        'date'[Year] = MAX ( 'date'[Year] )
            &amp;amp;&amp;amp; 'date'[Month] = MAX ( 'date'[Month] )
            &amp;amp;&amp;amp; 'date'[date] &amp;lt;= MAX ( 'date'[date] )
    )
RETURN
    SUMX ( _t, [@sales] )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sales YTD: = 
VAR _t =
    FILTER (
        ADDCOLUMNS (
            ALL ( 'date'[date], 'date'[Year], 'date'[Month], 'date'[Day] ),
            "@sales", [Sales:]
        ),
        'date'[Year] = MAX ( 'date'[Year] )
            &amp;amp;&amp;amp; 'date'[date] &amp;lt;= MAX ( 'date'[date] )
    )
RETURN
    SUMX ( _t, [@sales] )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Sep 2024 06:04:40 GMT</pubDate>
    <dc:creator>Jihwan_Kim</dc:creator>
    <dc:date>2024-09-09T06:04:40Z</dc:date>
    <item>
      <title>Getting sum from cumulative table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-sum-from-cumulative-table/m-p/4139822#M164479</link>
      <description>&lt;P&gt;Hello everyone, i have a sample table like this picture:&lt;/P&gt;&lt;P&gt;I'll describe the table columns:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;date : &lt;/STRONG&gt;obviously date&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;sales: &lt;/STRONG&gt;sold thing&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;sales_running_sum: &lt;/STRONG&gt;this is for monthly sales, reset to 0 every month (when the month change)&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;yearly_running_sum: &lt;/STRONG&gt;this is for yearly/annual sales, reset to 0 every year (when the year change)&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I have a problem, whenever i use &lt;EM&gt;&lt;STRONG&gt;TOTALYTD&lt;/STRONG&gt;&lt;/EM&gt; DAX for &lt;STRONG&gt;yearly_running_sum&lt;/STRONG&gt; and &lt;EM&gt;&lt;STRONG&gt;TOTALMTD&lt;/STRONG&gt;&lt;/EM&gt; DAX for &lt;STRONG&gt;sales_running_sum. &lt;/STRONG&gt;The sum is exponentially large, what i want is when i choose &lt;EM&gt;February 10, 2024&lt;/EM&gt; it'd show 40 for &lt;STRONG&gt;sales_running_sum&lt;/STRONG&gt;&amp;nbsp; and 144 for &lt;STRONG&gt;yearly_running_sum. &lt;/STRONG&gt;Is there any implementation to get result that i want?&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;&lt;img /&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2024 05:29:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-sum-from-cumulative-table/m-p/4139822#M164479</guid>
      <dc:creator>jdw_msft</dc:creator>
      <dc:date>2024-09-09T05:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: Getting sum from cumulative table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-sum-from-cumulative-table/m-p/4139918#M164490</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I tried to create a sample pbix file like below, and please check the below picture and the attached pbix file.&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sales MTD: = 
VAR _t =
    FILTER (
        ADDCOLUMNS (
            ALL ( 'date'[date], 'date'[Year], 'date'[Month], 'date'[Day] ),
            "@sales", [Sales:]
        ),
        'date'[Year] = MAX ( 'date'[Year] )
            &amp;amp;&amp;amp; 'date'[Month] = MAX ( 'date'[Month] )
            &amp;amp;&amp;amp; 'date'[date] &amp;lt;= MAX ( 'date'[date] )
    )
RETURN
    SUMX ( _t, [@sales] )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sales YTD: = 
VAR _t =
    FILTER (
        ADDCOLUMNS (
            ALL ( 'date'[date], 'date'[Year], 'date'[Month], 'date'[Day] ),
            "@sales", [Sales:]
        ),
        'date'[Year] = MAX ( 'date'[Year] )
            &amp;amp;&amp;amp; 'date'[date] &amp;lt;= MAX ( 'date'[date] )
    )
RETURN
    SUMX ( _t, [@sales] )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2024 06:04:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-sum-from-cumulative-table/m-p/4139918#M164490</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-09-09T06:04:40Z</dc:date>
    </item>
  </channel>
</rss>

