<?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 Rolling Average in Quick Measures Gallery</title>
    <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Rolling-Average/m-p/160720#M3</link>
    <description>&lt;P&gt;This measure calculates a rolling average. It takes a set number of periods before and after the&amp;nbsp;current filter context and does an average over those values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;Name:&lt;/H4&gt;
&lt;P&gt;Rolling average&lt;/P&gt;
&lt;H4&gt;Description:&lt;/H4&gt;
&lt;P&gt;Calculate the average of the value for a set number of periods before and after the filtered date&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;Parameters:&lt;/H4&gt;
&lt;P&gt;Name: Base value&lt;/P&gt;
&lt;P&gt;Tooltip: The value you want to average&lt;/P&gt;
&lt;P&gt;Type: Numerical field / measure&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Name:&amp;nbsp;Date&lt;/P&gt;
&lt;P&gt;Tooltip: The dates over which you want to calculate the average&lt;/P&gt;
&lt;P&gt;Type: Date field&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Name: Period&lt;/P&gt;
&lt;P&gt;Tooltip: The time periods between which you want to average&lt;/P&gt;
&lt;P&gt;Type: Enum, from Days, Months, Quarters, Years&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Name: Periods before&lt;/P&gt;
&lt;P&gt;Tooltip: The number of periods to average before each date&lt;/P&gt;
&lt;P&gt;Type: Integer&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Name: Periods after&lt;/P&gt;
&lt;P&gt;Tooltip: The number&amp;nbsp; of periods to average after each date&lt;/P&gt;
&lt;P&gt;Type: Integer&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;DAX:&lt;/H4&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;{Base value} rolling average = &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;IF(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;ISFILTERED({Date}),&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy."),&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;VAR __LAST_DATE =&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;LASTDATE({Date}.[Date])&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;RETURN&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;AVERAGEX(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;DATESBETWEEN(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; {Date}.[Date],&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; DATEADD(__LAST_DATE, {Periods Before}, {Period}),&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; DATEADD(__LAST_DATE, {Periods After}, {Period}),&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;),&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;CALCULATE({Base value})&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="reportid hidden"&gt;eyJrIjoiN2ExNWFjOGItN2IwNC00MTkzLWIyMDAtYWI4YjdiMjlhMWQ2IiwidCI6IjNlN2ZjNjM1LTkxOTAtNDFmMC04MDZiLWI4OWIwZmJkNzU5ZSIsImMiOjF9&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Apr 2017 22:05:03 GMT</pubDate>
    <dc:creator>WillT</dc:creator>
    <dc:date>2017-04-18T22:05:03Z</dc:date>
    <item>
      <title>Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Rolling-Average/m-p/160720#M3</link>
      <description>&lt;P&gt;This measure calculates a rolling average. It takes a set number of periods before and after the&amp;nbsp;current filter context and does an average over those values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;Name:&lt;/H4&gt;
&lt;P&gt;Rolling average&lt;/P&gt;
&lt;H4&gt;Description:&lt;/H4&gt;
&lt;P&gt;Calculate the average of the value for a set number of periods before and after the filtered date&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;Parameters:&lt;/H4&gt;
&lt;P&gt;Name: Base value&lt;/P&gt;
&lt;P&gt;Tooltip: The value you want to average&lt;/P&gt;
&lt;P&gt;Type: Numerical field / measure&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Name:&amp;nbsp;Date&lt;/P&gt;
&lt;P&gt;Tooltip: The dates over which you want to calculate the average&lt;/P&gt;
&lt;P&gt;Type: Date field&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Name: Period&lt;/P&gt;
&lt;P&gt;Tooltip: The time periods between which you want to average&lt;/P&gt;
&lt;P&gt;Type: Enum, from Days, Months, Quarters, Years&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Name: Periods before&lt;/P&gt;
&lt;P&gt;Tooltip: The number of periods to average before each date&lt;/P&gt;
&lt;P&gt;Type: Integer&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Name: Periods after&lt;/P&gt;
&lt;P&gt;Tooltip: The number&amp;nbsp; of periods to average after each date&lt;/P&gt;
&lt;P&gt;Type: Integer&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;DAX:&lt;/H4&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;{Base value} rolling average = &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;IF(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;ISFILTERED({Date}),&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy."),&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;VAR __LAST_DATE =&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;LASTDATE({Date}.[Date])&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;RETURN&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;AVERAGEX(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;DATESBETWEEN(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; {Date}.[Date],&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; DATEADD(__LAST_DATE, {Periods Before}, {Period}),&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; DATEADD(__LAST_DATE, {Periods After}, {Period}),&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;),&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;CALCULATE({Base value})&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="reportid hidden"&gt;eyJrIjoiN2ExNWFjOGItN2IwNC00MTkzLWIyMDAtYWI4YjdiMjlhMWQ2IiwidCI6IjNlN2ZjNjM1LTkxOTAtNDFmMC04MDZiLWI4OWIwZmJkNzU5ZSIsImMiOjF9&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2017 22:05:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Rolling-Average/m-p/160720#M3</guid>
      <dc:creator>WillT</dc:creator>
      <dc:date>2017-04-18T22:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Rolling-Average/m-p/188545#M17</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="7" data-lia-user-login="WillT" class="lia-mention lia-mention-user"&gt;WillT&lt;/a&gt;&amp;nbsp;can you share a sample for this example. Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2017 01:23:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Rolling-Average/m-p/188545#M17</guid>
      <dc:creator>Stharwani</dc:creator>
      <dc:date>2017-06-06T01:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Rolling-Average/m-p/217146#M34</link>
      <description>&lt;P&gt;Both files are png - can you please share .pbix?&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jul 2017 21:59:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Rolling-Average/m-p/217146#M34</guid>
      <dc:creator>Vladisam</dc:creator>
      <dc:date>2017-07-23T21:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Rolling-Average/m-p/283099#M66</link>
      <description>&lt;P&gt;Thanks for sharing&amp;nbsp;the details for the rolling average quick measure.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I get an incorrect result when&amp;nbsp;I use a&amp;nbsp;base value requires a different date field&amp;nbsp;in the calculation.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, I'd like to calculate the rolling average for my base value 'FoundationCount' below.&amp;nbsp; My main date table is CohortDate[Date] which points to several date fields in Cohort_Roster table including Cohort_Roster[FoundationsDate].&amp;nbsp; &amp;nbsp;The relationship to Cohort_Roster[FoundationsDate] is inactive by default so I activate it when needed below.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FoundationsCount := CALCULATE( countx(Cohort_Roster,Cohort_Roster[FoundationsDate]), USERELATIONSHIP(CohortDate[Date],Cohort_Roster[FoundationsDate] ))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you advise any edits to the DAX code above where I could add 'USERELATIONSHIP' to pick up the correct date values?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 20:57:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Rolling-Average/m-p/283099#M66</guid>
      <dc:creator>jboyd170</dc:creator>
      <dc:date>2017-10-19T20:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Rolling-Average/m-p/355662#M99</link>
      <description>&lt;P&gt;I tried this measure and it worked fine as long as I didn't try to edit the DAX expression. As soon as I did, I got a syntax error as described&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Desktop/DATEADD-Syntax-error-DAX-argument-separator-comma-semicolon/m-p/50742/highlight/false#M20304" target="_self"&gt;here&lt;/A&gt;. This makes for a very&amp;nbsp;confusing&amp;nbsp;experience and I would suggest to either fix the cause of the syntax error (seems unlikely) or to insert a space before the commata after&amp;nbsp;&lt;SPAN&gt;{Periods Before} and&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;{Periods After}.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 20:16:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Rolling-Average/m-p/355662#M99</guid>
      <dc:creator>Chris12</dc:creator>
      <dc:date>2018-02-09T20:16:35Z</dc:date>
    </item>
  </channel>
</rss>

