<?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: Moving Average based on number of samples or time in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-based-on-number-of-samples-or-time/m-p/2585263#M74331</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I do not know how your data model looks like, but I think it is possible by using dim-time table for the calculation of 3 hrs segment.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Fri, 17 Jun 2022 09:36:32 GMT</pubDate>
    <dc:creator>Jihwan_Kim</dc:creator>
    <dc:date>2022-06-17T09:36:32Z</dc:date>
    <item>
      <title>Moving Average based on number of samples or time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-based-on-number-of-samples-or-time/m-p/2583524#M74219</link>
      <description>&lt;P&gt;Hello, I have found many threads about moving average but they are all based on date filters (e.g. moving average based on a time windows of at least 1 day). In my report I need to implement a moving average based on a specific number of samples (e.g. buffer size of 10 samples) or based on hours (time window of 3 hours).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How is this possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 15:13:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-based-on-number-of-samples-or-time/m-p/2583524#M74219</guid>
      <dc:creator>marco_2020</dc:creator>
      <dc:date>2022-06-16T15:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Average based on number of samples or time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-based-on-number-of-samples-or-time/m-p/2583801#M74238</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure if I understood your question correctly.&lt;/P&gt;
&lt;P&gt;I tried to create a sample pbix file like below, and the below sample is showing last 10 samples moving avg.&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;LI-CODE lang="markup"&gt;Moving avg of last 10 index measure: =
AVERAGEX (
    TOPN (
        10,
        FILTER ( ALL ( Data ), Data[Index] &amp;lt;= MAX ( Data[Index] ) ),
        Data[Index], DESC
    ),
    Data[Value]
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 17:50:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-based-on-number-of-samples-or-time/m-p/2583801#M74238</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2022-06-16T17:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Average based on number of samples or time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-based-on-number-of-samples-or-time/m-p/2584775#M74294</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;really thank you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My last concern is regarding computing moving average in a dataset over datetime column considering for example last 3 hours as time window. Is this possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2022 07:00:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-based-on-number-of-samples-or-time/m-p/2584775#M74294</guid>
      <dc:creator>marco_2020</dc:creator>
      <dc:date>2022-06-17T07:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Average based on number of samples or time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-based-on-number-of-samples-or-time/m-p/2585263#M74331</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I do not know how your data model looks like, but I think it is possible by using dim-time table for the calculation of 3 hrs segment.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2022 09:36:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-based-on-number-of-samples-or-time/m-p/2585263#M74331</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2022-06-17T09:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Average based on number of samples or time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-based-on-number-of-samples-or-time/m-p/2593798#M74790</link>
      <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="245057" data-lia-user-login="marco_2020" class="lia-mention lia-mention-user"&gt;marco_2020&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You can try the following dax:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Meaure =
VAR currDate =
    MAX ( Table[LOAD_END_TIME] )
RETURN
    CALCULATE (
        AVERAGE ( Table[SHOVEL_TRUCK_DIFFERENCE] ),
        FILTER (
            ALLSELECTED ( Table ),
            [LOAD_END_TIME] &amp;lt;= currDate
                &amp;amp;&amp;amp; DATEDIFF ( [LOAD_END_TIME], currDate, SECOND ) &amp;lt;= 1800
        )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 05:42:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-based-on-number-of-samples-or-time/m-p/2593798#M74790</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-22T05:42:15Z</dc:date>
    </item>
  </channel>
</rss>

