<?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 Total of Two Measures from Separate Tables in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Total-of-Two-Measures-from-Separate-Tables/m-p/4372740#M173603</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="424059" data-lia-user-login="third_hicana" class="lia-mention lia-mention-user"&gt;third_hicana&lt;/a&gt;&amp;nbsp; The&amp;nbsp;issue with your DAX formula is,&amp;nbsp; inside calculate you have used ALL&amp;nbsp;function, which is removing the filter context from the Calendar, which might be causing the cumulative calculation to go wrong. You need to use ALL function inside the FILTER function to correctly evaluates cumulative totals. Try the below code:&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;Cumulative Total = 
VAR maxDate = MAX('Calendar'[Date])
RETURN
CALCULATE(
    [Measure Total],
    FILTER(
        ALL('Calendar'),
        'Calendar'[Date] &amp;lt;= maxDate
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;ALL function is used within the FILTER&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;function to remove any existing filters on the Calendar,&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;but the FILTER&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;function then reapplies the filter to only include dates up to maxDate.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I have tried the scenario and found the result you want. Check this:&lt;/SPAN&gt;&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;Hope this helps!!&lt;/P&gt;
&lt;P&gt;If this solved your problem, please accept it as a solution and a kudos!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Shahariar Hafiz&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Jan 2025 03:42:09 GMT</pubDate>
    <dc:creator>shafiz_p</dc:creator>
    <dc:date>2025-01-21T03:42:09Z</dc:date>
    <item>
      <title>Cumulative Total of Two Measures from Separate Tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Total-of-Two-Measures-from-Separate-Tables/m-p/4372720#M173599</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi. I just want to ask a help on calculating cumulative totals based on two measures from separate tables.&lt;/P&gt;&lt;P&gt;I have a data model below. What I did was, I created a measure for Table 1 and Table 2. Then I add them up by simpling doing addition Measure 1 + Measure 2. Let's call it Measure Total. Then I used the DAX below. However, I got a wrong cumulative value (see second image)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Cumulative Total =&lt;/P&gt;&lt;P&gt;Var maxDate = MAX(Calendar Table[Date]&lt;/P&gt;&lt;P&gt;Return&lt;/P&gt;&lt;P&gt;CALCULATE(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Measure Total,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ALL(Calendar Table),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(Calendar Table[Date] =&amp;lt; maxDate)))&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Wrong cumulative&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance for any help you can give.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 03:06:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Total-of-Two-Measures-from-Separate-Tables/m-p/4372720#M173599</guid>
      <dc:creator>third_hicana</dc:creator>
      <dc:date>2025-01-21T03:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Total of Two Measures from Separate Tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Total-of-Two-Measures-from-Separate-Tables/m-p/4372740#M173603</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="424059" data-lia-user-login="third_hicana" class="lia-mention lia-mention-user"&gt;third_hicana&lt;/a&gt;&amp;nbsp; The&amp;nbsp;issue with your DAX formula is,&amp;nbsp; inside calculate you have used ALL&amp;nbsp;function, which is removing the filter context from the Calendar, which might be causing the cumulative calculation to go wrong. You need to use ALL function inside the FILTER function to correctly evaluates cumulative totals. Try the below code:&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;Cumulative Total = 
VAR maxDate = MAX('Calendar'[Date])
RETURN
CALCULATE(
    [Measure Total],
    FILTER(
        ALL('Calendar'),
        'Calendar'[Date] &amp;lt;= maxDate
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;ALL function is used within the FILTER&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;function to remove any existing filters on the Calendar,&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;but the FILTER&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;function then reapplies the filter to only include dates up to maxDate.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I have tried the scenario and found the result you want. Check this:&lt;/SPAN&gt;&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;Hope this helps!!&lt;/P&gt;
&lt;P&gt;If this solved your problem, please accept it as a solution and a kudos!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Shahariar Hafiz&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 03:42:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Total-of-Two-Measures-from-Separate-Tables/m-p/4372740#M173603</guid>
      <dc:creator>shafiz_p</dc:creator>
      <dc:date>2025-01-21T03:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Total of Two Measures from Separate Tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Total-of-Two-Measures-from-Separate-Tables/m-p/4372745#M173604</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="736379" data-lia-user-login="shafiz_p" class="lia-mention lia-mention-user"&gt;shafiz_p&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;When I only selected 3 dates in the slicer, it does not give the cumulative of the selected beginning date up to the last selected date. For example, if I want to select from March to May, the Cumulative Total should be&lt;BR /&gt;March 200&lt;BR /&gt;April 450&lt;BR /&gt;May 800&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 03:51:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Total-of-Two-Measures-from-Separate-Tables/m-p/4372745#M173604</guid>
      <dc:creator>third_hicana</dc:creator>
      <dc:date>2025-01-21T03:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Total of Two Measures from Separate Tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Total-of-Two-Measures-from-Separate-Tables/m-p/4372746#M173605</link>
      <description>&lt;P&gt;I think ALLSELECTED will work&lt;BR /&gt;&lt;BR /&gt;Cumulative Total =&lt;BR /&gt;VAR maxDate = MAX('Calendar'[Date])&lt;BR /&gt;RETURN&lt;BR /&gt;CALCULATE(&lt;BR /&gt;[Measure Total],&lt;BR /&gt;FILTER(&lt;BR /&gt;ALLSELECTED('Calendar'),&lt;BR /&gt;'Calendar'[Date] &amp;lt;= maxDate&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 03:58:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Total-of-Two-Measures-from-Separate-Tables/m-p/4372746#M173605</guid>
      <dc:creator>third_hicana</dc:creator>
      <dc:date>2025-01-21T03:58:52Z</dc:date>
    </item>
  </channel>
</rss>

