<?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 calculate Filterd VAR table to  cumulative value in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-Filterd-VAR-table-to-cumulative-value/m-p/4081867#M162044</link>
    <description>&lt;P&gt;Hello everyone! I came back again,,,&lt;span class="lia-unicode-emoji" title=":persevering_face:"&gt;😣&lt;/span&gt;&lt;BR /&gt;I want to make a table filtered and summary values cumulative,but this doesn't work.How should I correct it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Ftd_sum :=
VAR tbl = 
    SELECTCOLUMNS(
        FILTER(ALL('TEST_'), 'TEST_'[STS] = "〇"),
        "@Trg", 'TEST_'[PN]
    )
VAR Dis = 
    DISTINCT(tbl)   // OK
VAR Ftd = 
    CALCULATETABLE(
        'TEST_',
        'TEST_'[PN] IN Dis,
        FILTER(
            ALLSELECTED('Calendar'),
            'Calendar'[Date] &amp;lt;= MAX('Calendar'[Date])
        ),
        USERELATIONSHIP('Calendar'[Date], 'TEST_'[Calculated])
    )

VAR Result = 
    CALCULATE(
        SUM('TEST_'[Qty]), 
        KEEPFILTERS(Ftd)
    )
      
RETURN 
    Result&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Table (I'm doing it on powerpivot)&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;want it to be&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thank you for reading,and continuous support!&lt;BR /&gt;Best Regards,&lt;/P&gt;</description>
    <pubDate>Mon, 05 Aug 2024 23:19:56 GMT</pubDate>
    <dc:creator>ohnothimagain</dc:creator>
    <dc:date>2024-08-05T23:19:56Z</dc:date>
    <item>
      <title>calculate Filterd VAR table to  cumulative value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-Filterd-VAR-table-to-cumulative-value/m-p/4081867#M162044</link>
      <description>&lt;P&gt;Hello everyone! I came back again,,,&lt;span class="lia-unicode-emoji" title=":persevering_face:"&gt;😣&lt;/span&gt;&lt;BR /&gt;I want to make a table filtered and summary values cumulative,but this doesn't work.How should I correct it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Ftd_sum :=
VAR tbl = 
    SELECTCOLUMNS(
        FILTER(ALL('TEST_'), 'TEST_'[STS] = "〇"),
        "@Trg", 'TEST_'[PN]
    )
VAR Dis = 
    DISTINCT(tbl)   // OK
VAR Ftd = 
    CALCULATETABLE(
        'TEST_',
        'TEST_'[PN] IN Dis,
        FILTER(
            ALLSELECTED('Calendar'),
            'Calendar'[Date] &amp;lt;= MAX('Calendar'[Date])
        ),
        USERELATIONSHIP('Calendar'[Date], 'TEST_'[Calculated])
    )

VAR Result = 
    CALCULATE(
        SUM('TEST_'[Qty]), 
        KEEPFILTERS(Ftd)
    )
      
RETURN 
    Result&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Table (I'm doing it on powerpivot)&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;want it to be&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thank you for reading,and continuous support!&lt;BR /&gt;Best Regards,&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 23:19:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-Filterd-VAR-table-to-cumulative-value/m-p/4081867#M162044</guid>
      <dc:creator>ohnothimagain</dc:creator>
      <dc:date>2024-08-05T23:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: calculate Filterd VAR table to  cumulative value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-Filterd-VAR-table-to-cumulative-value/m-p/4082432#M162056</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="778360" data-lia-user-login="ohnothimagain" class="lia-mention lia-mention-user"&gt;ohnothimagain&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;What about modifying it as shown below?&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Ftd_sum :=
VAR tbl = 
    SELECTCOLUMNS(
        FILTER(ALL('TEST_'), 'TEST_'[STS] = "〇"),
        "@Trg", 'TEST_'[PN]
    )
VAR Dis = 
    DISTINCT(tbl)   // OK
VAR Ftd = 
    CALCULATETABLE(
        'TEST_',
        'TEST_'[PN] IN Dis,
        FILTER(
            ALLSELECTED('Calendar'),
            'Calendar'[Date] &amp;lt;= MAX('Calendar'[Date])
        ),
        USERELATIONSHIP('Calendar'[Date], 'TEST_'[Calculated])
    )

VAR Result = 
    CALCULATE(
        SUM('TEST_'[Qty]), 
        KEEPFILTERS(Ftd)
    )
      
RETURN 
    Result
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;Best regards,&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 21:35:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-Filterd-VAR-table-to-cumulative-value/m-p/4082432#M162056</guid>
      <dc:creator>DataNinja777</dc:creator>
      <dc:date>2024-08-05T21:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: calculate Filterd VAR table to  cumulative value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-Filterd-VAR-table-to-cumulative-value/m-p/4083444#M162087</link>
      <description>&lt;P&gt;Thank you for your reply!&lt;/P&gt;&lt;P&gt;I tried,but it returned non-cumulative values.do you have any ideas more?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2024 07:31:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-Filterd-VAR-table-to-cumulative-value/m-p/4083444#M162087</guid>
      <dc:creator>ohnothimagain</dc:creator>
      <dc:date>2024-08-06T07:31:33Z</dc:date>
    </item>
  </channel>
</rss>

