<?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: Running sum with Period in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-sum-with-Period/m-p/1012731#M12964</link>
    <description>&lt;P&gt;Try using one of my formulas changing the max_date like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
VAR max_date = 
CALCULATE (
    MAX(Burn[TrxnDate]);
    FILTER(
        ALL(Burn[TrxnDate];Burn[ACTUAL]);
        OR( Burn[ACTUAL]&amp;gt;0 ; Burn[ACTUAL] &amp;lt;&amp;gt; BLANK() )
    )
)
RETURN
--Formula--&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;That should be the max date of the actual values. Then you can use that as variable of the other formulas.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;</description>
    <pubDate>Tue, 07 Apr 2020 13:37:56 GMT</pubDate>
    <dc:creator>ibarrau</dc:creator>
    <dc:date>2020-04-07T13:37:56Z</dc:date>
    <item>
      <title>Running sum with Period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-sum-with-Period/m-p/1012446#M12953</link>
      <description>&lt;P&gt;Dear experts,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a situation where I wanted to show the running total in a line chart for Actuals, Expected, and Variance, we are able to get the values and create the visual. But having a small issue on the actual and variance line. The budget is for the 12 periods, but actual is only for 6 months. Therefore we wanted to stop the actual and variance line where we have actual expenses (period 6) but it shows until period 12. I have attached here a screenshot for your easy reference.&amp;nbsp;&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;Following is the formula has been set up,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Actual = CALCULATE(SUM(Burn[ACTUAL]),FILTER(ALLSELECTED(Burn),Burn[TrxnDate]&amp;lt;=MAX(Burn[TrxnDate])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Variance = CALCULATE(SUM(Burn[VARIANCE]),FILTER(ALLSELECTED(Burn),Burn[TrxnDate]&amp;lt;=MAX(Burn[TrxnDate])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Expected = CALCULATE(SUM(Burn[BUDGET]),FILTER(ALLSELECTED(Burn),Burn[TrxnDate]&amp;lt;=MAX(Burn[TrxnDate])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;How can we stop the actual and variance lines from the current actual period?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Osmand&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 07 Apr 2020 10:53:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-sum-with-Period/m-p/1012446#M12953</guid>
      <dc:creator>Osmandfernanobi</dc:creator>
      <dc:date>2020-04-07T10:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: Running sum with Period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-sum-with-Period/m-p/1012543#M12955</link>
      <description>&lt;P&gt;Hi. I see. The idea of this is to recognize the "Stop Here" automatically. We can help you do it if you tell us more about it&lt;/P&gt;
&lt;P&gt;Is actual in a separate table?&lt;/P&gt;
&lt;P&gt;Is there only one table in the model?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For now I'll show an example without it. You can resolve this in two different ways. The first and most importante is to recognize automatically the "max_date" variable. Then you can just call the calculation before that date or complete with blank for the next days of that date:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure 1 = 
VAR max_date = DATE(2009;1;1)
RETURN
CALCULATE( [SalesAmount]; InternetSales[Order Date] &amp;lt; max_date )

Measure 2 =
VAR max_date = DATE(2009;1;1)
RETURN
IF(
    MAX(InternetSales[Order Date]) &amp;gt; max_date ;
    BLANK();
    [SalesAmount]
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Build this measures for Budget and Variance (my sales amount should be your budget)&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 13:34:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-sum-with-Period/m-p/1012543#M12955</guid>
      <dc:creator>ibarrau</dc:creator>
      <dc:date>2020-04-07T13:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: Running sum with Period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-sum-with-Period/m-p/1012600#M12958</link>
      <description>&lt;P&gt;Same Osmand here, I am confused with my community accounts,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="11211" data-lia-user-login="ibarrau" class="lia-mention lia-mention-user"&gt;ibarrau&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actual is not a separate table, All those 3 data fields (Actual, Expected, Variance) are in a new table created based on a another table name Burn,&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are several tables as you can see below&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;Thank you&lt;/P&gt;&lt;P&gt;Osmand&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 12:43:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-sum-with-Period/m-p/1012600#M12958</guid>
      <dc:creator>osmandfernando</dc:creator>
      <dc:date>2020-04-07T12:43:52Z</dc:date>
    </item>
    <item>
      <title>Re: Running sum with Period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-sum-with-Period/m-p/1012637#M12959</link>
      <description>&lt;P&gt;Well, those measures are probably the "Sum" of something. Can you show us the columns involved in the tables that are used in the measures? Right there I can't see anything related with actual due to measures are not related with the table in which they are created.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 12:56:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-sum-with-Period/m-p/1012637#M12959</guid>
      <dc:creator>ibarrau</dc:creator>
      <dc:date>2020-04-07T12:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: Running sum with Period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-sum-with-Period/m-p/1012657#M12961</link>
      <description>&lt;P&gt;Thank you for the reply&lt;/P&gt;&lt;P&gt;following are the formulas&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;Actual = CALCULATE(SUM(Burn[ACTUAL]),FILTER(ALLSELECTED(Burn),Burn[TrxnDate]&amp;lt;=MAX(Burn[TrxnDate])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Variance = CALCULATE(SUM(Burn[VARIANCE]),FILTER(ALLSELECTED(Burn),Burn[TrxnDate]&amp;lt;=MAX(Burn[TrxnDate])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Expected = CALCULATE(SUM(Burn[BUDGET]),FILTER(ALLSELECTED(Burn),Burn[TrxnDate]&amp;lt;=MAX(Burn[TrxnDate])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 07 Apr 2020 13:07:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-sum-with-Period/m-p/1012657#M12961</guid>
      <dc:creator>osmandfernando</dc:creator>
      <dc:date>2020-04-07T13:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Running sum with Period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-sum-with-Period/m-p/1012731#M12964</link>
      <description>&lt;P&gt;Try using one of my formulas changing the max_date like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
VAR max_date = 
CALCULATE (
    MAX(Burn[TrxnDate]);
    FILTER(
        ALL(Burn[TrxnDate];Burn[ACTUAL]);
        OR( Burn[ACTUAL]&amp;gt;0 ; Burn[ACTUAL] &amp;lt;&amp;gt; BLANK() )
    )
)
RETURN
--Formula--&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;That should be the max date of the actual values. Then you can use that as variable of the other formulas.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 13:37:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-sum-with-Period/m-p/1012731#M12964</guid>
      <dc:creator>ibarrau</dc:creator>
      <dc:date>2020-04-07T13:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: Running sum with Period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-sum-with-Period/m-p/1021291#M13225</link>
      <description>&lt;P&gt;I can see you don't have a proper Date table in the model. This will lead to a lot of issues and bugs you will not even be aware of. Please watch these before starting modeling in PBI:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=78d6mwR8GtA" target="_blank"&gt;https://www.youtube.com/watch?v=78d6mwR8GtA&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=_quTwyvDfG0" target="_blank"&gt;https://www.youtube.com/watch?v=_quTwyvDfG0&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and read this to know why you should always use correct star schemas:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sqlbi.com/articles/understanding-dax-auto-exist/" target="_blank"&gt;https://www.sqlbi.com/articles/understanding-dax-auto-exist/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, here's how to properly deal with the future in time-intel calculations:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sqlbi.com/articles/hiding-future-dates-for-calculations-in-dax/" target="_blank"&gt;https://www.sqlbi.com/articles/hiding-future-dates-for-calculations-in-dax/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;BR /&gt;D&lt;/P&gt;</description>
      <pubDate>Sun, 12 Apr 2020 14:02:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-sum-with-Period/m-p/1021291#M13225</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-12T14:02:39Z</dc:date>
    </item>
    <item>
      <title>Re: Running sum with Period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-sum-with-Period/m-p/1021886#M13252</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;Thank you for your great ideas.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="11211" data-lia-user-login="ibarrau" class="lia-mention lia-mention-user"&gt;ibarrau&lt;/a&gt;&amp;nbsp;Thank you for your replies, I tried the formula you gave me but it did not work. To make the things simple I created a simple table visual. Then I created a Running sun measure for actuals. The following is the screenshot of it. I want to stop showing the running total from Period 6 onwards. How can I do it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Following is the formula I have for the running total&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ACTUAL running total in MONTH = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SUM('Burn'[ACTUAL]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FILTER(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ALLSELECTED('Burn'[MONTH]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ISONORAFTER('Burn'[MONTH], MAX('Burn'[MONTH]), DESC)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Osmand&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2020 04:23:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-sum-with-Period/m-p/1021886#M13252</guid>
      <dc:creator>Osmandfernanobi</dc:creator>
      <dc:date>2020-04-13T04:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: Running sum with Period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-sum-with-Period/m-p/1022331#M13257</link>
      <description>Hi there. If you really had taken my advice seriously, you'd now know how to do such a thing:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.sqlbi.com/articles/hiding-future-dates-for-calculations-in-dax/" target="_blank"&gt;https://www.sqlbi.com/articles/hiding-future-dates-for-calculations-in-dax/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
      <pubDate>Mon, 13 Apr 2020 09:55:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-sum-with-Period/m-p/1022331#M13257</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-13T09:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: Running sum with Period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-sum-with-Period/m-p/1022679#M13275</link>
      <description>&lt;P&gt;Thank for your article I am trying to apply your solution but I am still unable to get it correct.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Osmand&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2020 14:13:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-sum-with-Period/m-p/1022679#M13275</guid>
      <dc:creator>Osmandfernanobi</dc:creator>
      <dc:date>2020-04-13T14:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: Running sum with Period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-sum-with-Period/m-p/1022755#M13277</link>
      <description>That's because you are not following Best Practices. Please have a look at how to correctly apply time intelligence in a model:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.sqlbi.com/tv/time-intelligence-in-microsoft-power-bi/" target="_blank"&gt;https://www.sqlbi.com/tv/time-intelligence-in-microsoft-power-bi/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
      <pubDate>Mon, 13 Apr 2020 14:34:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-sum-with-Period/m-p/1022755#M13277</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-13T14:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: Running sum with Period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-sum-with-Period/m-p/1022759#M13278</link>
      <description>You will not be getting things right until you have a correct model where there are separate date/time dimensions.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
      <pubDate>Mon, 13 Apr 2020 14:36:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-sum-with-Period/m-p/1022759#M13278</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-13T14:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: Running sum with Period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-sum-with-Period/m-p/1023866#M13295</link>
      <description>&lt;P&gt;Thank you for your support&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 05:58:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-sum-with-Period/m-p/1023866#M13295</guid>
      <dc:creator>osmandfernando</dc:creator>
      <dc:date>2020-04-14T05:58:35Z</dc:date>
    </item>
  </channel>
</rss>

