<?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 - not date based in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2951985#M97926</link>
    <description>&lt;P&gt;you sir are a hero &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;thanks so much!&lt;/P&gt;</description>
    <pubDate>Tue, 06 Dec 2022 16:12:23 GMT</pubDate>
    <dc:creator>dantheram</dc:creator>
    <dc:date>2022-12-06T16:12:23Z</dc:date>
    <item>
      <title>Moving Average - not date based</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2904368#M94699</link>
      <description>&lt;P&gt;hi all&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i'm really struggling to understand how to compile what should be a very simple MAA. The issue is that i do not use date, i use period numbers; 1 to 13, as below -&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;all i want is a moving average (for incidents) across the last 13 periods, so for P5 above the value would be the average of periods; 6,7,8,9,10,11,12,13,1,2,3,4,5.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i just cannot get it to work, any help much appreciated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 17:53:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2904368#M94699</guid>
      <dc:creator>dantheram</dc:creator>
      <dc:date>2022-11-14T17:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Average - not date based</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2904455#M94706</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="335103" data-lia-user-login="dantheram" class="lia-mention lia-mention-user"&gt;dantheram&lt;/a&gt;&amp;nbsp;Try adding an index so that you have something to define "before"&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 18:23:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2904455#M94706</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2022-11-14T18:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Average - not date based</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2904507#M94711</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Please check the below measure and the attached pbix file.&lt;/P&gt;
&lt;P&gt;I tried to create a sample pbix file like the attached file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Moving avg 13 periods: =
VAR _currentperiod =
    MAX ( Data[Period] )
VAR _currentFYone =
    LEFT ( MAX ( Data[Fiscal Year] ), 4 ) * 1
VAR _newtableone =
    FILTER (
        ALL ( Data ),
        Data[Fiscal Year] = MAX ( Data[Fiscal Year] )
            &amp;amp;&amp;amp; Data[Period] &amp;lt;= _currentperiod
    )
VAR _newtabletwo =
    FILTER (
        ALL ( Data ),
        LEFT ( Data[Fiscal Year], 4 ) * 1 = _currentFYone - 1
            &amp;amp;&amp;amp; Data[Period] &amp;gt; _currentperiod
    )
VAR _unionnewtables =
    UNION ( _newtableone, _newtabletwo )
RETURN
    IF (
        HASONEVALUE ( Data[Period] ),
        SUMX ( _unionnewtables, Data[Incident Count] ) / 13
    )
&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 14 Nov 2022 18:45:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2904507#M94711</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2022-11-14T18:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Average - not date based</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2904531#M94714</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="335103" data-lia-user-login="dantheram" class="lia-mention lia-mention-user"&gt;dantheram&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you can create a calculated column for fiscal year rank&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Fiscal Period Rank =
RANKX (
    'Date',
    VALUE ( LEFT ( 'Date'[Fiscal Year], 4 ) ) * 100 + 'Date'[Period],
    ,
    asc,
    DENSE
)&lt;/LI-CODE&gt;
&lt;P&gt;then the measure would be&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Incident Count MA =
VAR CurrentRank =
    MAX ( 'Date'[Fiscal Period Rank] )
VAR T1 =
    FILTER (
        ALLSELECTED ( 'Date'[Fiscal Period Rank] ),
        'Date'[Fiscal Period Rank] &amp;lt;= CurrentRank
            &amp;amp;&amp;amp; 'Date'[Fiscal Period Rank] &amp;gt;= CurrentRank - 12
    )
RETURN
    AVERAGEX (
        T1,
        VAR CurrentRank2 = 'Date'[Fiscal Period Rank]
        RETURN
            CALCULATE (
                [Incident Count],
                REMOVEFILTERS ( 'Date' ),
                'Date'[Fiscal Period Rank] = CurrentRank2
            )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 18:54:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2904531#M94714</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-11-14T18:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Average - not date based</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2904568#M94717</link>
      <description>&lt;P&gt;thanks all - i'll be trying some of these tomrrow&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 19:13:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2904568#M94717</guid>
      <dc:creator>dantheram</dc:creator>
      <dc:date>2022-11-14T19:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Average - not date based</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2949280#M97698</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this one works fine but does not recalculate when i add in some of the lower level categories.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, my 'incidents' field can be split by geography or a sub category - how do i make the calculation dynamic?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 18:27:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2949280#M97698</guid>
      <dc:creator>dantheram</dc:creator>
      <dc:date>2022-12-05T18:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Average - not date based</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2949288#M97699</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Please provide sample pbix file's link and then I can try to look into it to come up with a solution.&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 18:35:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2949288#M97699</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2022-12-05T18:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Average - not date based</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2949304#M97700</link>
      <description>&lt;P&gt;i cant see an option to upload the file, here is a link -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://networkrail-my.sharepoint.com/:u:/r/personal/dschofie_networkrail_co_uk/Documents/Profile/Desktop/SAFs/Derby%20SAFs.pbix?csf=1&amp;amp;web=1&amp;amp;e=XDA9Zc" target="_blank"&gt;Derby SAFs.pbix&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 18:41:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2949304#M97700</guid>
      <dc:creator>dantheram</dc:creator>
      <dc:date>2022-12-05T18:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Average - not date based</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2949333#M97705</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this one fails at the rank stage -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"a single value for column 'financial year in table 'SAFs Actuals' cannot be determined. this can happen when a measure formula refers to...."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any ideas?&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 18:53:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2949333#M97705</guid>
      <dc:creator>dantheram</dc:creator>
      <dc:date>2022-12-05T18:53:50Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Average - not date based</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2949339#M97708</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="335103" data-lia-user-login="dantheram" class="lia-mention lia-mention-user"&gt;dantheram&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is supposed to be a calculated column not a measure. Please read my answer above carefully&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 18:56:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2949339#M97708</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-12-05T18:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Average - not date based</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2949534#M97728</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;apologies - i've added to the file as a calc'd column and it works but the same problem observed with the other solution offered here - no recalcualtion when i add in other categories; i.e. if i split the incidents counts down by geography the MAA stays based on the total&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Dan&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 21:11:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2949534#M97728</guid>
      <dc:creator>dantheram</dc:creator>
      <dc:date>2022-12-05T21:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Average - not date based</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2949543#M97730</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="335103" data-lia-user-login="dantheram" class="lia-mention lia-mention-user"&gt;dantheram&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Also please note that a Date table is required for this solution to work properly.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 21:13:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2949543#M97730</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-12-05T21:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Average - not date based</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2949546#M97731</link>
      <description>&lt;P&gt;so is the rank added to the 'date' table or the 'incident count' data table?&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 21:17:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2949546#M97731</guid>
      <dc:creator>dantheram</dc:creator>
      <dc:date>2022-12-05T21:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Average - not date based</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2949567#M97734</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="335103" data-lia-user-login="dantheram" class="lia-mention lia-mention-user"&gt;dantheram&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;The Date table&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 21:40:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2949567#M97734</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-12-05T21:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Average - not date based</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2949642#M97737</link>
      <description>&lt;P&gt;done - but its simply returing the period value &amp;gt;&amp;gt;&amp;gt;&amp;gt;&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;</description>
      <pubDate>Mon, 05 Dec 2022 22:07:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2949642#M97737</guid>
      <dc:creator>dantheram</dc:creator>
      <dc:date>2022-12-05T22:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Average - not date based</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2950119#M97771</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure but I think it is asking to login. If it is OK with you, could you please share it via onedrive, googledrive, or dropbox?&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 04:03:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2950119#M97771</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2022-12-06T04:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Average - not date based</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2950198#M97773</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="335103" data-lia-user-login="dantheram" class="lia-mention lia-mention-user"&gt;dantheram&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;The [Financial Year] and [Period] are from which table?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 05:10:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2950198#M97773</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-12-06T05:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Average - not date based</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2951148#M97830</link>
      <description>&lt;P&gt;correct - i had used the wrong date table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;just need to tidy up the output now; how do i stop it starting at 600 and running on past period 5 (the last period with data, so the year to date in effect)?&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 10:38:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2951148#M97830</guid>
      <dc:creator>dantheram</dc:creator>
      <dc:date>2022-12-06T10:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Average - not date based</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2951165#M97832</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="335103" data-lia-user-login="dantheram" class="lia-mention lia-mention-user"&gt;dantheram&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Please clarify further&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 10:44:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2951165#M97832</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-12-06T10:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: Moving Average - not date based</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2951176#M97833</link>
      <description>&lt;P&gt;hi Tamer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the main issue is the calc running on past the year to date row - period 5, so it's picking up all the 0's and reducing the MA value, i need it to stop at the max value for period in the incident count dataset - so period 5&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 10:46:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Moving-Average-not-date-based/m-p/2951176#M97833</guid>
      <dc:creator>dantheram</dc:creator>
      <dc:date>2022-12-06T10:46:59Z</dc:date>
    </item>
  </channel>
</rss>

