<?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: How to  calculate Filterd VAR table by cumulative total in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-Filterd-VAR-table-by-cumulative-total/m-p/4096627#M162575</link>
    <description>&lt;P&gt;Thank you again!&lt;BR /&gt;I just copied that you wrote as "Ftd_sum2" ,but unfortunately it was unsuccess..(blank values)&lt;BR /&gt;can you think of anything that might have caused it??&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;/P&gt;</description>
    <pubDate>Tue, 13 Aug 2024 05:06:50 GMT</pubDate>
    <dc:creator>ohnothimagain</dc:creator>
    <dc:date>2024-08-13T05:06:50Z</dc:date>
    <item>
      <title>How to  calculate Filterd VAR table by cumulative total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-Filterd-VAR-table-by-cumulative-total/m-p/4093183#M162432</link>
      <description>&lt;P&gt;Hello everyone. I came back again...&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)   
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;&lt;/P&gt;&lt;P&gt;&lt;BR /&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thank you for reading,and continuous support!&lt;BR /&gt;(Thank&amp;nbsp;Anonymous&lt;/LI-USER&gt;Ninja for cooperation previously,but still unsuccess)&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;/P&gt;</description>
      <pubDate>Sun, 11 Aug 2024 11:04:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-Filterd-VAR-table-by-cumulative-total/m-p/4093183#M162432</guid>
      <dc:creator>ohnothimagain</dc:creator>
      <dc:date>2024-08-11T11:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to  calculate Filterd VAR table by cumulative total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-Filterd-VAR-table-by-cumulative-total/m-p/4094078#M162461</link>
      <description>&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;&lt;BR /&gt;Do not include sensitive information or anything not related to the issue or question. &lt;BR /&gt;&lt;BR /&gt;If you are unsure how to upload data please refer to &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Aug 2024 22:50:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-Filterd-VAR-table-by-cumulative-total/m-p/4094078#M162461</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-08-11T22:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to  calculate Filterd VAR table by cumulative total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-Filterd-VAR-table-by-cumulative-total/m-p/4094129#M162465</link>
      <description>&lt;P&gt;Hey&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;,&lt;BR /&gt;Try this code, and if you encounter any issues, let me know:&lt;BR /&gt;&lt;BR /&gt;Ftd_sum :=&lt;BR /&gt;VAR tbl =&lt;BR /&gt;SELECTCOLUMNS(FILTER(ALL('TEST_'), 'TEST_'[STS] = "〇"),&lt;BR /&gt;"@Trg", 'TEST_'[PN])&lt;BR /&gt;VAR Dis =&lt;BR /&gt;DISTINCT(tbl)&lt;BR /&gt;VAR Ftd =CALCULATETABLE(&lt;BR /&gt;'TEST_',FILTER(ALLSELECTED('TEST_'),'TEST_'[PN] IN Dis))&lt;BR /&gt;VAR Result =CALCULATE(SUM('TEST_'[Qty]),&lt;/P&gt;&lt;P&gt;FILTER(ALLSELECTED('Calendar'),'Calendar'[Date] &amp;lt;= MAX('Calendar'[Date])),KEEPFILTERS(Ftd))&lt;BR /&gt;RETURN&lt;BR /&gt;Result&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2024 00:12:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-Filterd-VAR-table-by-cumulative-total/m-p/4094129#M162465</guid>
      <dc:creator>ahadkarimi</dc:creator>
      <dc:date>2024-08-12T00:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to  calculate Filterd VAR table by cumulative total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-Filterd-VAR-table-by-cumulative-total/m-p/4094176#M162466</link>
      <description>&lt;P&gt;Thank you for your reply! but&amp;nbsp; I'm afraid to say that&amp;nbsp; I'm not in usable condition so far.&lt;/P&gt;&lt;P&gt;Anyway,once again I really appreciate your support.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2024 01:46:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-Filterd-VAR-table-by-cumulative-total/m-p/4094176#M162466</guid>
      <dc:creator>ohnothimagain</dc:creator>
      <dc:date>2024-08-12T01:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to  calculate Filterd VAR table by cumulative total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-Filterd-VAR-table-by-cumulative-total/m-p/4094366#M162476</link>
      <description>&lt;P&gt;Thank you for your reply! I tried right away,definately got closer! (got cumulative total)&lt;BR /&gt;I have additional questions;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. I need to add "use relationship" how should I write this..?&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;following doesn't work.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;var Ftd
=CALCULATETABLE('TEST_',
                  filter(allselected(TEST_),'TEST_'[PN] IN Dis),
                      USERELATIONSHIP('Calendar'[Date],'TEST_'[Calculated]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;2.If I need to calculate as the same way with distinct [PO]column,how should I do it??&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2024 03:31:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-Filterd-VAR-table-by-cumulative-total/m-p/4094366#M162476</guid>
      <dc:creator>ohnothimagain</dc:creator>
      <dc:date>2024-08-12T03:31:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to  calculate Filterd VAR table by cumulative total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-Filterd-VAR-table-by-cumulative-total/m-p/4095478#M162523</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;go ahead and use this code, and if there are any issues, just let me know.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Ftd :=
    CALCULATETABLE(
        'TEST_',
        FILTER(ALLSELECTED('TEST_'), 'TEST_'[PN] IN Dis),
        USERELATIONSHIP('Calendar'[Date], 'TEST_'[Calculated])
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then, use :&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)
VAR Ftd = 
    CALCULATETABLE(
        'TEST_',
        FILTER(ALLSELECTED('TEST_'), 'TEST_'[PN] IN Dis),
        USERELATIONSHIP('Calendar'[Date], 'TEST_'[Calculated])
    )
VAR Result = 
    CALCULATE(
        SUM('TEST_'[Qty]),
        FILTER(
            ALLSELECTED('Calendar'),
            'Calendar'[Date] &amp;lt;= MAX('Calendar'[Date])
        ),
        KEEPFILTERS(Ftd)
    )
RETURN 
    Result&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Calculate&amp;nbsp;distinct [PO]column:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Ftd_sum_PO :=
VAR tbl = 
    SELECTCOLUMNS(
        FILTER(ALL('TEST_'), 'TEST_'[STS] = "〇"),
        "@Trg", 'TEST_'[PO]  -- Change to the PO column
    )
VAR Dis = 
    DISTINCT(tbl)
VAR Ftd = 
    CALCULATETABLE(
        'TEST_',
        FILTER(ALLSELECTED('TEST_'), 'TEST_'[PO] IN Dis),
        USERELATIONSHIP('Calendar'[Date], 'TEST_'[Calculated])
    )
VAR Result = 
    CALCULATE(
        SUM('TEST_'[Qty]),
        FILTER(
            ALLSELECTED('Calendar'),
            'Calendar'[Date] &amp;lt;= MAX('Calendar'[Date])
        ),
        KEEPFILTERS(Ftd)
    )
RETURN 
    Result&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2024 13:08:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-Filterd-VAR-table-by-cumulative-total/m-p/4095478#M162523</guid>
      <dc:creator>ahadkarimi</dc:creator>
      <dc:date>2024-08-12T13:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to  calculate Filterd VAR table by cumulative total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-Filterd-VAR-table-by-cumulative-total/m-p/4096627#M162575</link>
      <description>&lt;P&gt;Thank you again!&lt;BR /&gt;I just copied that you wrote as "Ftd_sum2" ,but unfortunately it was unsuccess..(blank values)&lt;BR /&gt;can you think of anything that might have caused it??&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;/P&gt;</description>
      <pubDate>Tue, 13 Aug 2024 05:06:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-Filterd-VAR-table-by-cumulative-total/m-p/4096627#M162575</guid>
      <dc:creator>ohnothimagain</dc:creator>
      <dc:date>2024-08-13T05:06:50Z</dc:date>
    </item>
  </channel>
</rss>

