<?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 Running Max/Min/Avg of Running Total in Quick Measures Gallery</title>
    <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Running-Max-Min-Avg-of-Running-Total/m-p/164346#M7</link>
    <description>&lt;P&gt;This measure calculates the running max/min/average (depending on your requirement) of a running total based on the dynamic date range selected. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To recap, here is the Running Total quick measure that Power BI gives us. &amp;nbsp;A measure like this should be be present in your model.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;Running Total := 
CALCULATE(
	'Sales'[Amount],
	FILTER(
		ALLSELECTED('Date'[Date]),
		ISONORAFTER('Date'[Date], MAX('Date'[Date]), DESC)
	)
)&lt;/PRE&gt;
&lt;P&gt;Below is an example of how to set up a running MAX of the running total shown above:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Max of Running Total :=
VAR __INTERIM_CALC =
    ADDCOLUMNS (
        SUMMARIZE ( ALLSELECTED ( 'Date' ), 'Date'[Date] ),
        "__RunningTotal", [Running Total]
    )
RETURN
    MAXX (
        FILTER (
            __INTERIM_CALC,
            ISONORAFTER ( 'Date'[Date], MAX ( 'Date'[Date] ), DESC )
        ),
        [__RunningTotal]
    )&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To find the running&amp;nbsp;&lt;EM&gt;&lt;/EM&gt;average/minimum/etc. of the running total, just change the&amp;nbsp;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;EM&gt;MAXX&lt;/EM&gt; in the above query to AVERAGEX, MINX, or another AGGX function.&lt;/P&gt;</description>
    <pubDate>Tue, 25 Apr 2017 16:34:56 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-04-25T16:34:56Z</dc:date>
    <item>
      <title>Running Max/Min/Avg of Running Total</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Running-Max-Min-Avg-of-Running-Total/m-p/164346#M7</link>
      <description>&lt;P&gt;This measure calculates the running max/min/average (depending on your requirement) of a running total based on the dynamic date range selected. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To recap, here is the Running Total quick measure that Power BI gives us. &amp;nbsp;A measure like this should be be present in your model.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;Running Total := 
CALCULATE(
	'Sales'[Amount],
	FILTER(
		ALLSELECTED('Date'[Date]),
		ISONORAFTER('Date'[Date], MAX('Date'[Date]), DESC)
	)
)&lt;/PRE&gt;
&lt;P&gt;Below is an example of how to set up a running MAX of the running total shown above:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Max of Running Total :=
VAR __INTERIM_CALC =
    ADDCOLUMNS (
        SUMMARIZE ( ALLSELECTED ( 'Date' ), 'Date'[Date] ),
        "__RunningTotal", [Running Total]
    )
RETURN
    MAXX (
        FILTER (
            __INTERIM_CALC,
            ISONORAFTER ( 'Date'[Date], MAX ( 'Date'[Date] ), DESC )
        ),
        [__RunningTotal]
    )&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To find the running&amp;nbsp;&lt;EM&gt;&lt;/EM&gt;average/minimum/etc. of the running total, just change the&amp;nbsp;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;EM&gt;MAXX&lt;/EM&gt; in the above query to AVERAGEX, MINX, or another AGGX function.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 16:34:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Running-Max-Min-Avg-of-Running-Total/m-p/164346#M7</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-25T16:34:56Z</dc:date>
    </item>
  </channel>
</rss>

