<?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 for past 30 days in minutes in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-for-past-30-days-in-minutes/m-p/2739564#M84137</link>
    <description>&lt;P&gt;How do I create a 30-day rolling average field to account for timestamp (each minute). So far it makes sense for my current rolling average field to show the 30 day rolling average for each date, but not each minute. When I add timestamp to the table, it throws the rolling average off. Any thoughts on how I can do that&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;&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;&lt;BR /&gt;Rolling_Average =&lt;BR /&gt;VAR NumDays = 30&lt;BR /&gt;Var RollingSum =&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; CALCULATE(&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SUM(Query1[LAST_FILL]),&lt;BR /&gt;DATESINPERIOD(Query1[Date], LASTDATE(Query1[DATE]), -NumDays, DAY), ALL(Query1[Timestamp])&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;)&lt;BR /&gt;RETURN&lt;BR /&gt;RollingSum/NumDays&lt;/P&gt;</description>
    <pubDate>Thu, 01 Sep 2022 03:59:25 GMT</pubDate>
    <dc:creator>woofwoof123</dc:creator>
    <dc:date>2022-09-01T03:59:25Z</dc:date>
    <item>
      <title>Rolling average for past 30 days in minutes</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-for-past-30-days-in-minutes/m-p/2739564#M84137</link>
      <description>&lt;P&gt;How do I create a 30-day rolling average field to account for timestamp (each minute). So far it makes sense for my current rolling average field to show the 30 day rolling average for each date, but not each minute. When I add timestamp to the table, it throws the rolling average off. Any thoughts on how I can do that&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;&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;&lt;BR /&gt;Rolling_Average =&lt;BR /&gt;VAR NumDays = 30&lt;BR /&gt;Var RollingSum =&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; CALCULATE(&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SUM(Query1[LAST_FILL]),&lt;BR /&gt;DATESINPERIOD(Query1[Date], LASTDATE(Query1[DATE]), -NumDays, DAY), ALL(Query1[Timestamp])&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;)&lt;BR /&gt;RETURN&lt;BR /&gt;RollingSum/NumDays&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2022 03:59:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-for-past-30-days-in-minutes/m-p/2739564#M84137</guid>
      <dc:creator>woofwoof123</dc:creator>
      <dc:date>2022-09-01T03:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average for past 30 days in minutes</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-for-past-30-days-in-minutes/m-p/2742453#M84333</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="435458" data-lia-user-login="woofwoof123" class="lia-mention lia-mention-user"&gt;woofwoof123&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I think you can try this code.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Rolling_Average =
CALCULATE (
    AVERAGE ( Query1[LAST_FILL]),
    FILTER (
        ALL ( 'query' ),
        'query'[Date] &amp;lt;= MAX ( 'query'[Date] )
            &amp;amp;&amp;amp; 'query'[Date]
                &amp;gt; MAX ( 'query'[Date] ) - 30
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I have misunderstood your meaning, please provide a pbix file without privacy information and more details with your desired output.&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;</description>
      <pubDate>Fri, 02 Sep 2022 06:31:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-for-past-30-days-in-minutes/m-p/2742453#M84333</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-02T06:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average for past 30 days in minutes</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-for-past-30-days-in-minutes/m-p/2746484#M84601</link>
      <description>&lt;P&gt;the file is connected to a database connection and is too large to share. But essentially I am trying to have something like a 9am-5pm graph that shows today's "LAST_FILL" and the past 30days rolling average in minutes. Not days... but minutes. Minutes, because the data is in minutes.&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;So I want it to look like LAST_FILLS per minute 9-5 intraday vs. average LAST_FILLS of past 30 days in minutes.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 00:07:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-for-past-30-days-in-minutes/m-p/2746484#M84601</guid>
      <dc:creator>woofwoof123</dc:creator>
      <dc:date>2022-09-05T00:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average for past 30 days in minutes</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-for-past-30-days-in-minutes/m-p/2747178#M84648</link>
      <description>&lt;P&gt;First off, when using time-intel functions in PBI you have to have a well-formed dates table and you don't. Please consult the docs on&amp;nbsp;&lt;A href="http://dax.guide/datesinperiod" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;DATESINPERIOD&lt;/STRONG&gt;&lt;/A&gt;. If you follow Best Practices, this might resolve your problem right away. Seriously.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 08:02:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-for-past-30-days-in-minutes/m-p/2747178#M84648</guid>
      <dc:creator>daXtreme</dc:creator>
      <dc:date>2022-09-05T08:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average for past 30 days in minutes</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-for-past-30-days-in-minutes/m-p/2748847#M84748</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Attaching this image above to use as a "reference". Instead of EMA (Exponential Moving Average), I want just a 30-day moving average vs Intraday data.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 01:09:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-for-past-30-days-in-minutes/m-p/2748847#M84748</guid>
      <dc:creator>woofwoof123</dc:creator>
      <dc:date>2022-09-06T01:09:45Z</dc:date>
    </item>
  </channel>
</rss>

