<?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 - stopping after last date not working with hierarchy in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-total-stopping-after-last-date-not-working-with/m-p/1924580#M41741</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1736" data-lia-user-login="joemillson" class="lia-mention lia-mention-user"&gt;joemillson&lt;/a&gt; , This seems fine and should work in a hierarchy. Just make sure that all these Fiscal Year, Qtr, and Month are coming from date table, d_time_Dates and that is marked as date table&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this too&lt;/P&gt;
&lt;P&gt;Cml Actual Invoices =&lt;BR /&gt;VAR LastSalesDate = maxx(ALL(f_scoro_SalesInvoicesActual),f_scoro_SalesInvoicesActual[Date Invoice])&lt;BR /&gt;RETURN&lt;BR /&gt;IF(&lt;BR /&gt;max(d_time_Dates[Date]) &amp;gt; LastSalesDate, BLANK(),&lt;BR /&gt;CALCULATE([Sum of Actual Invoices],&lt;BR /&gt;FILTER(ALLSELECTED(d_time_Dates),d_time_Dates[Date] &amp;lt;= MAX(d_time_Dates[Date]))))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cml Actual Invoices =&lt;BR /&gt;VAR LastSalesDate = maxx(ALL(f_scoro_SalesInvoicesActual),f_scoro_SalesInvoicesActual[Date Invoice])&lt;BR /&gt;RETURN&lt;BR /&gt;CALCULATE([Sum of Actual Invoices],&lt;BR /&gt;FILTER(ALLSELECTED(d_time_Dates),d_time_Dates[Date] &amp;lt;= MAX(d_time_Dates[Date]) &amp;amp;&amp;amp; (d_time_Dates[Date]) &amp;lt;= LastSalesDate))&lt;/P&gt;</description>
    <pubDate>Mon, 28 Jun 2021 05:38:12 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2021-06-28T05:38:12Z</dc:date>
    <item>
      <title>Cumulative total - stopping after last date not working with hierarchy</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-total-stopping-after-last-date-not-working-with/m-p/1923919#M41723</link>
      <description>&lt;P&gt;Hi - i've created a measure &lt;A href="https://www.youtube.com/watch?v=JnhXyQ8eyuo&amp;amp;list=PLyTW_4MFTLL7Bl0ZLTJWeCDBGW4FRrH3m&amp;amp;index=10" target="_self"&gt;as shown here&lt;/A&gt; to create a cumulative sum up to the last sales date, then to give a blank after that date:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Cml Actual Invoices = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR LastSalesDate = CALCULATE(LASTDATE(f_scoro_SalesInvoicesActual[Date Invoice]),ALL())&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF( &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SELECTEDVALUE(d_time_Dates[Date]) &amp;gt; LastSalesDate, BLANK(),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE([Sum of Actual Invoices],&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FILTER(ALLSELECTED(d_time_Dates),d_time_Dates[Date] &amp;lt;= MAX(d_time_Dates[Date]))))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;It shows correctly if my visual is operating at the single date level:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;However I need to be able to move up / down a date hierarchy and for the measure to work, which is currently is not doing, as shown below if i move up to Month granularity, the meaure no longer returns a blank after the last sale date, and repeats the cumulative total for months beyond the last date:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img /&gt;&lt;P&gt;I think I understand why, becuase in my measure I'm calculating based on the full date key and not the month, however I don't know the solution. Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 27 Jun 2021 11:26:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-total-stopping-after-last-date-not-working-with/m-p/1923919#M41723</guid>
      <dc:creator>joemillson</dc:creator>
      <dc:date>2021-06-27T11:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative total - stopping after last date not working with hierarchy</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-total-stopping-after-last-date-not-working-with/m-p/1924580#M41741</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1736" data-lia-user-login="joemillson" class="lia-mention lia-mention-user"&gt;joemillson&lt;/a&gt; , This seems fine and should work in a hierarchy. Just make sure that all these Fiscal Year, Qtr, and Month are coming from date table, d_time_Dates and that is marked as date table&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this too&lt;/P&gt;
&lt;P&gt;Cml Actual Invoices =&lt;BR /&gt;VAR LastSalesDate = maxx(ALL(f_scoro_SalesInvoicesActual),f_scoro_SalesInvoicesActual[Date Invoice])&lt;BR /&gt;RETURN&lt;BR /&gt;IF(&lt;BR /&gt;max(d_time_Dates[Date]) &amp;gt; LastSalesDate, BLANK(),&lt;BR /&gt;CALCULATE([Sum of Actual Invoices],&lt;BR /&gt;FILTER(ALLSELECTED(d_time_Dates),d_time_Dates[Date] &amp;lt;= MAX(d_time_Dates[Date]))))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cml Actual Invoices =&lt;BR /&gt;VAR LastSalesDate = maxx(ALL(f_scoro_SalesInvoicesActual),f_scoro_SalesInvoicesActual[Date Invoice])&lt;BR /&gt;RETURN&lt;BR /&gt;CALCULATE([Sum of Actual Invoices],&lt;BR /&gt;FILTER(ALLSELECTED(d_time_Dates),d_time_Dates[Date] &amp;lt;= MAX(d_time_Dates[Date]) &amp;amp;&amp;amp; (d_time_Dates[Date]) &amp;lt;= LastSalesDate))&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jun 2021 05:38:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-total-stopping-after-last-date-not-working-with/m-p/1924580#M41741</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-06-28T05:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative total - stopping after last date not working with hierarchy</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-total-stopping-after-last-date-not-working-with/m-p/1924753#M41746</link>
      <description>&lt;P&gt;Thanks very much - the first alternative works perfectly.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jun 2021 06:36:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-total-stopping-after-last-date-not-working-with/m-p/1924753#M41746</guid>
      <dc:creator>joemillson</dc:creator>
      <dc:date>2021-06-28T06:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative total - stopping after last date not working with hierarchy</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-total-stopping-after-last-date-not-working-with/m-p/3532486#M135744</link>
      <description>&lt;P&gt;The first option works just as I needed. Thank you so much!&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 08:05:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-total-stopping-after-last-date-not-working-with/m-p/3532486#M135744</guid>
      <dc:creator>JoaoEccel</dc:creator>
      <dc:date>2023-11-14T08:05:40Z</dc:date>
    </item>
  </channel>
</rss>

