<?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 Emission with Filter condition in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Emission-with-Filter-condition/m-p/2660678#M78883</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="398589" data-lia-user-login="sam_hoccane" class="lia-mention lia-mention-user"&gt;sam_hoccane&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I have created a simple sample, please refer to my pbix file to see if it help you.&lt;/P&gt;
&lt;P&gt;Create a measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
VAR _result =
    CALCULATE (
        SUM ( 'Table'[Emission] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[date] &amp;lt;= SELECTEDVALUE ( 'Table'[date] )
                &amp;amp;&amp;amp; 'Table'[Forecasst] = "N"
        )
    )
RETURN
    IF ( MAX ( 'Table'[Forecasst] ) = "N", _result, BLANK () )
&lt;/LI-CODE&gt;
&lt;P&gt;Or a column.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column =
VAR _result =
    CALCULATE (
        SUM ( 'Table'[Emission] ),
        FILTER (
            ( 'Table' ),
            'Table'[date] &amp;lt;= EARLIER ( 'Table'[date] )
                &amp;amp;&amp;amp; 'Table'[Forecasst] = "N"
        )
    )
RETURN
    IF ( 'Table'[Forecasst] = "N", _result, BLANK () )
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If I have misunderstood your meaning, please provide your pbix file without privacy information and your desired output with more details.&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 _ Polly&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 26 Jul 2022 04:05:21 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-07-26T04:05:21Z</dc:date>
    <item>
      <title>Cumulative Emission with Filter condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Emission-with-Filter-condition/m-p/2656189#M78509</link>
      <description>&lt;P&gt;Hi Community,&lt;/P&gt;&lt;P&gt;&lt;A title="Data PowerBI File" href="https://drive.google.com/file/d/1RY_T-zwVKtXHH0OHxaPFVrlzYHa_pdGh/view?usp=sharing" target="_blank" rel="noopener"&gt;Data PowerBI File&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Could you please help me finding cummulative emission with Filter condition&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create a measure that can calculate emission up till Forecast value is "N".&amp;nbsp; I&amp;nbsp; am trying with following measure but I am still getting values where forecast is "Y".&amp;nbsp; so, my goal is create&amp;nbsp; measure that calculate cummulative total up till&amp;nbsp; Forecast value is "N" and rest is blank.&amp;nbsp; &amp;nbsp;&amp;nbsp;I guess it is happenig becasue of ALL.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Actual Cumulative Emissions = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;_table&lt;/SPAN&gt;&lt;SPAN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t;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;My expected results should look like this&lt;/P&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thankyou in Anticipation&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 22 Jul 2022 16:23:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Emission-with-Filter-condition/m-p/2656189#M78509</guid>
      <dc:creator>sam_hoccane</dc:creator>
      <dc:date>2022-07-22T16:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Emission with Filter condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Emission-with-Filter-condition/m-p/2656245#M78514</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="398589" data-lia-user-login="sam_hoccane" class="lia-mention lia-mention-user"&gt;sam_hoccane&lt;/a&gt; , Try one of the two&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Actual Cumulative Emissions =&lt;BR /&gt;VAR _max = maxx(filter(allselected(data) ,data[Forecast]="N"), data[Date]) &lt;BR /&gt;VAR _cumulative_before_forecast = CALCULATE( SUM(data[Emission]) , FILTER ( ALLSELECTED(data), data[Date] &amp;lt;= MAX( data[Date]) &amp;amp;&amp;amp; data[Date] &amp;lt;=_max &amp;amp;&amp;amp; data[Forecast]="N"))&lt;BR /&gt;Return _cumulative_before_forecast&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Actual Cumulative Emissions =&lt;BR /&gt;VAR _max = maxx(filter(allselected(data) ,data[Forecast]="N"), data[Date]) &lt;BR /&gt;VAR _cumulative_before_forecast = if( max(data[Date]) &amp;lt;=_max ,CALCULATE( SUM(data[Emission]) , FILTER ( ALLSELECTED(data), data[Date] &amp;lt;= MAX( data[Date]) &amp;amp;&amp;amp; data[Forecast]="N")), blank())&lt;BR /&gt;Return _cumulative_before_forecast&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 16:53:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Emission-with-Filter-condition/m-p/2656245#M78514</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-07-22T16:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Emission with Filter condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Emission-with-Filter-condition/m-p/2660678#M78883</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="398589" data-lia-user-login="sam_hoccane" class="lia-mention lia-mention-user"&gt;sam_hoccane&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I have created a simple sample, please refer to my pbix file to see if it help you.&lt;/P&gt;
&lt;P&gt;Create a measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
VAR _result =
    CALCULATE (
        SUM ( 'Table'[Emission] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[date] &amp;lt;= SELECTEDVALUE ( 'Table'[date] )
                &amp;amp;&amp;amp; 'Table'[Forecasst] = "N"
        )
    )
RETURN
    IF ( MAX ( 'Table'[Forecasst] ) = "N", _result, BLANK () )
&lt;/LI-CODE&gt;
&lt;P&gt;Or a column.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column =
VAR _result =
    CALCULATE (
        SUM ( 'Table'[Emission] ),
        FILTER (
            ( 'Table' ),
            'Table'[date] &amp;lt;= EARLIER ( 'Table'[date] )
                &amp;amp;&amp;amp; 'Table'[Forecasst] = "N"
        )
    )
RETURN
    IF ( 'Table'[Forecasst] = "N", _result, BLANK () )
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If I have misunderstood your meaning, please provide your pbix file without privacy information and your desired output with more details.&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 _ Polly&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2022 04:05:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Emission-with-Filter-condition/m-p/2660678#M78883</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-26T04:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Emission with Filter condition</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Emission-with-Filter-condition/m-p/2667375#M79364</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;Thank you. It wokred .&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 13:01:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Emission-with-Filter-condition/m-p/2667375#M79364</guid>
      <dc:creator>sam_hoccane</dc:creator>
      <dc:date>2022-07-28T13:01:02Z</dc:date>
    </item>
  </channel>
</rss>

