<?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 stop accumulated measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-stop-accumulated-measure/m-p/3546264#M136354</link>
    <description>&lt;P&gt;You can use this modified Dax:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Accumulated Sales =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM('Sales'[Sales Amount]),&lt;BR /&gt;FILTER(&lt;BR /&gt;ALL('Years since launch'),&lt;BR /&gt;'Years since launch'[Years since launch] &amp;lt;= MAX('Years since launch'[Years since launch]) &amp;amp;&amp;amp;&lt;BR /&gt;'Years since launch'[Years since launch] + [Years Elapsed] &amp;gt;= YEAR(TODAY())&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this formula, I've added a condition to check if the sum of the 'Years since launch' and the 'Years Elapsed' is greater than or equal to the current year. If it is, the accumulated sales calculation will stop, preventing the curve from extending beyond the current year.&lt;/P&gt;&lt;P&gt;Make sure you have a column named 'Years Elapsed' in your 'Years since launch' table, which represents the number of years elapsed since the launch. If you don't have this column, you can create it using the following DAX formula:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Years Elapsed = YEAR(TODAY()) - 'Years since launch'[Years since launch]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This assumes that your 'Years since launch' table has a column named 'Years since launch' containing the launch years of the products. Adjust the column names accordingly based on your actual data model.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In case there is still a problem, please feel free and explain your issue in detail,&amp;nbsp;It will be my pleasure to assist you in any way I can.&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Nov 2023 07:59:16 GMT</pubDate>
    <dc:creator>123abc</dc:creator>
    <dc:date>2023-11-22T07:59:16Z</dc:date>
    <item>
      <title>How to stop accumulated measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-stop-accumulated-measure/m-p/3545201#M136316</link>
      <description>&lt;P&gt;I want to conduct a study on the lifespan of products. For this purpose, I have created a measure that accumulates sales by years elapsed since the launch.&lt;/P&gt;&lt;P&gt;The formula is as follows:&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;SUM('Sales'[Sales Amount]),&lt;BR /&gt;FILTER(&lt;BR /&gt;ALL('Years since launch'),&lt;BR /&gt;'Years since launch'[Years since launch] &amp;lt;= MAX('Years since launch'[Years since launch])&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The resulting graphic will be this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;What happens? If we look at the example of 2016, the curve remains flat from year 8 onwards because from 2016 to 2023, 7 years have elapsed and there are no sales from year 8 onwards.&lt;/P&gt;&lt;P&gt;How should the DAX formula for accumulated sales be so that when the value of the x-axis is greater than the difference between today and the launch year, the calculation is interrupted?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Javier&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 16:18:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-stop-accumulated-measure/m-p/3545201#M136316</guid>
      <dc:creator>UCR522</dc:creator>
      <dc:date>2023-11-21T16:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to stop accumulated measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-stop-accumulated-measure/m-p/3546264#M136354</link>
      <description>&lt;P&gt;You can use this modified Dax:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Accumulated Sales =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM('Sales'[Sales Amount]),&lt;BR /&gt;FILTER(&lt;BR /&gt;ALL('Years since launch'),&lt;BR /&gt;'Years since launch'[Years since launch] &amp;lt;= MAX('Years since launch'[Years since launch]) &amp;amp;&amp;amp;&lt;BR /&gt;'Years since launch'[Years since launch] + [Years Elapsed] &amp;gt;= YEAR(TODAY())&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this formula, I've added a condition to check if the sum of the 'Years since launch' and the 'Years Elapsed' is greater than or equal to the current year. If it is, the accumulated sales calculation will stop, preventing the curve from extending beyond the current year.&lt;/P&gt;&lt;P&gt;Make sure you have a column named 'Years Elapsed' in your 'Years since launch' table, which represents the number of years elapsed since the launch. If you don't have this column, you can create it using the following DAX formula:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Years Elapsed = YEAR(TODAY()) - 'Years since launch'[Years since launch]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This assumes that your 'Years since launch' table has a column named 'Years since launch' containing the launch years of the products. Adjust the column names accordingly based on your actual data model.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In case there is still a problem, please feel free and explain your issue in detail,&amp;nbsp;It will be my pleasure to assist you in any way I can.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2023 07:59:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-stop-accumulated-measure/m-p/3546264#M136354</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2023-11-22T07:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to stop accumulated measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-stop-accumulated-measure/m-p/3548468#M136475</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="189509" data-lia-user-login="UCR522" class="lia-mention lia-mention-user"&gt;UCR522&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can try the following methods&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Result =
VAR _Sum =
    CALCULATE ( SUM ( 'Sales'[Sales Amount] ),
        FILTER ( ALL ( 'Years since launch' ),
            'Years since launch'[Years since launch]
                &amp;lt;= MAX ( 'Years since launch'[Years since launch] )
        )
    )
RETURN
    IF ( SELECTEDVALUE ( 'Years since launch'[Years since launch] )
            &amp;lt;= YEAR ( TODAY () )- CALCULATE ( MIN ( 'Years since launch'[Year] ), ALL ( 'Years since launch' ) ) + 1,
        _Sum,
        BLANK ()
    )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Is this the result you expect?&lt;/SPAN&gt; &lt;SPAN&gt;Please see the attached document.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _Charlotte&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;helps, then please consider&amp;nbsp;&lt;EM&gt;Accept it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2023 08:11:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-stop-accumulated-measure/m-p/3548468#M136475</guid>
      <dc:creator>v-zhangti</dc:creator>
      <dc:date>2023-11-23T08:11:49Z</dc:date>
    </item>
  </channel>
</rss>

