<?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 Averages - Relative Data Slicer in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Averages-Relative-Data-Slicer/m-p/1547082#M30590</link>
    <description>&lt;P&gt;I'd strongly and kindly suggest you read about ALLSELECTED. You're not using it properly and don't understand what it's for and how it behaves. Here's an article:&amp;nbsp;&lt;A href="https://www.sqlbi.com/articles/the-definitive-guide-to-allselected/" target="_blank"&gt;The definitive guide to ALLSELECTED - SQLBI&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 13 Dec 2020 09:39:01 GMT</pubDate>
    <dc:creator>daxer-almighty</dc:creator>
    <dc:date>2020-12-13T09:39:01Z</dc:date>
    <item>
      <title>Moving Averages - Relative Data Slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Averages-Relative-Data-Slicer/m-p/1547010#M30578</link>
      <description>&lt;P&gt;Hello - I am trying to use a DAX function to calculate the rolling average of Google Analytics sessions with a custom date range. I use the following function:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Rolling Average Sessions = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;AVERAGEX( &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FILTER( ALLSELECTED('Date Functions'[Date]), &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; &amp;nbsp;'Date Functions'[Date] &amp;lt;= MAX('Date Functions'[Date])), &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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;'Date Functions'[Sessions])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I assume the issue has something to do with having several instances of the same date because I believe these are hourly session totals. Any help would be much appreciated&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 13 Dec 2020 06:03:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Averages-Relative-Data-Slicer/m-p/1547010#M30578</guid>
      <dc:creator>brettmacdonald8</dc:creator>
      <dc:date>2020-12-13T06:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Averages - Relative Data Slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Averages-Relative-Data-Slicer/m-p/1547082#M30590</link>
      <description>&lt;P&gt;I'd strongly and kindly suggest you read about ALLSELECTED. You're not using it properly and don't understand what it's for and how it behaves. Here's an article:&amp;nbsp;&lt;A href="https://www.sqlbi.com/articles/the-definitive-guide-to-allselected/" target="_blank"&gt;The definitive guide to ALLSELECTED - SQLBI&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Dec 2020 09:39:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Averages-Relative-Data-Slicer/m-p/1547082#M30590</guid>
      <dc:creator>daxer-almighty</dc:creator>
      <dc:date>2020-12-13T09:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Averages - Relative Data Slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Averages-Relative-Data-Slicer/m-p/1547092#M30595</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="275628" data-lia-user-login="brettmacdonald8" class="lia-mention lia-mention-user"&gt;brettmacdonald8&lt;/a&gt;&amp;nbsp;, you might want to try this formula in a calculated column&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Rolling Average Sessions =
AVERAGEX (
    FILTER (
        ALL ( 'Date Functions'[Date] ),
        'Date Functions'[Date] &amp;lt;= EARLIER ( 'Date Functions'[Date] )
    ),
    'Date Functions'[Sessions]
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2020 03:28:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Averages-Relative-Data-Slicer/m-p/1547092#M30595</guid>
      <dc:creator>CNENFRNL</dc:creator>
      <dc:date>2020-12-14T03:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Averages - Relative Data Slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Averages-Relative-Data-Slicer/m-p/1547855#M30612</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="275628" data-lia-user-login="brettmacdonald8" class="lia-mention lia-mention-user"&gt;brettmacdonald8&lt;/a&gt; , Seems like you are creating like a column. For new column try like &lt;/P&gt;
&lt;P&gt;Rolling Average Sessions =&lt;BR /&gt;AVERAGEX(&lt;BR /&gt;FILTER( 'Date Functions',&lt;BR /&gt;'Date Functions'[Date] &amp;lt;= earlier('Date Functions'[Date])),&lt;BR /&gt;'Date Functions'[Sessions])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For new measure&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rolling Average Sessions =&lt;BR /&gt;AVERAGEX(&lt;BR /&gt;FILTER( ALLSELECTED('Date Functions'),&lt;BR /&gt;'Date Functions'[Date] &amp;lt;= MAX('Date Functions'[Date])),&lt;BR /&gt;'Date Functions'[Sessions])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or better to use a separate date table&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rolling Average Sessions =&lt;BR /&gt;AVERAGEX(&lt;BR /&gt;FILTER( ALLSELECTED('Date Functions'),&lt;BR /&gt;'Date Functions'[Date] &amp;lt;= MAX('Date Functions'[Date])),&lt;BR /&gt;'Date Functions'[Sessions])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rolling Average Sessions =&lt;BR /&gt;AVERAGEX(&lt;BR /&gt;FILTER( ALLSELECTED('Date'),&lt;BR /&gt;'Date'[Date] &amp;lt;= MAX('Date'[Date])),&lt;BR /&gt;'Date Functions'[Sessions])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :&lt;A href="https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions" target="_blank"&gt;radacad&lt;/A&gt; &lt;A href="https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/" target="_blank"&gt;sqlbi&lt;/A&gt; &lt;A href="https://www.youtube.com/playlist?list=PLPaNVDMhUXGYLz-w8ERQOo3KYARs7GgG-" target="_blank"&gt;My Video Series&lt;/A&gt; Appreciate your Kudos. &lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2020 02:42:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Averages-Relative-Data-Slicer/m-p/1547855#M30612</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-12-14T02:42:25Z</dc:date>
    </item>
  </channel>
</rss>

