<?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: Trailing 6 months average in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trailing-6-months-average/m-p/3144172#M112397</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="529688" data-lia-user-login="PB_MZ" class="lia-mention lia-mention-user"&gt;PB_MZ&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you can refer to below code to create measures.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Trailing 6 months average for Margin % (A) =
VAR _EndDate =
    MAX ( DimDate[Date] )
VAR _StartDate =
    EOMONTH ( _EndDate, -7 ) + 1
RETURN
    AVERAGEX (
        FILTER (
            ALL ( DimDate ),
            DimDate[Date] &amp;gt;= _StartDate
                &amp;amp;&amp;amp; DimDate[Date] &amp;lt;= _EndDate
        ),
        [Margin % (A)]
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&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>Tue, 21 Mar 2023 08:49:26 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-03-21T08:49:26Z</dc:date>
    <item>
      <title>Trailing 6 months average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trailing-6-months-average/m-p/3134438#M111665</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I would like to calculate the trailing 6 month average for Margin % (A),&amp;nbsp;Margin % (B),&amp;nbsp;Margin % (C). They are measures instead of columns.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I tried several ways but none of them worked for me. I am wondering if I can find some luck here. Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2023 19:57:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trailing-6-months-average/m-p/3134438#M111665</guid>
      <dc:creator>PB_MZ</dc:creator>
      <dc:date>2023-03-15T19:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: Trailing 6 months average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trailing-6-months-average/m-p/3134582#M111677</link>
      <description>&lt;P&gt;hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="529688" data-lia-user-login="PB_MZ" class="lia-mention lia-mention-user"&gt;PB_MZ&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what do you mean by "&lt;SPAN&gt;trailing 6 month average&lt;/SPAN&gt;"?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2023 21:51:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trailing-6-months-average/m-p/3134582#M111677</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2023-03-15T21:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: Trailing 6 months average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trailing-6-months-average/m-p/3144172#M112397</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="529688" data-lia-user-login="PB_MZ" class="lia-mention lia-mention-user"&gt;PB_MZ&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you can refer to below code to create measures.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Trailing 6 months average for Margin % (A) =
VAR _EndDate =
    MAX ( DimDate[Date] )
VAR _StartDate =
    EOMONTH ( _EndDate, -7 ) + 1
RETURN
    AVERAGEX (
        FILTER (
            ALL ( DimDate ),
            DimDate[Date] &amp;gt;= _StartDate
                &amp;amp;&amp;amp; DimDate[Date] &amp;lt;= _EndDate
        ),
        [Margin % (A)]
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&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>Tue, 21 Mar 2023 08:49:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trailing-6-months-average/m-p/3144172#M112397</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-21T08:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Trailing 6 months average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trailing-6-months-average/m-p/3144839#M112453</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Sorry for the late resposne. Trailing 6 months average means I need to calculate the average of (previous 5 months + current month) for each month.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 13:54:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trailing-6-months-average/m-p/3144839#M112453</guid>
      <dc:creator>PB_MZ</dc:creator>
      <dc:date>2023-03-21T13:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: Trailing 6 months average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trailing-6-months-average/m-p/3144944#M112465</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thank you for your response. But unforturnately, I didn't get the results I want by your way. Correct me if I was wrong.&lt;/P&gt;&lt;P&gt;This is the code:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;And this is the result from your code:&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;</description>
      <pubDate>Tue, 21 Mar 2023 14:40:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trailing-6-months-average/m-p/3144944#M112465</guid>
      <dc:creator>PB_MZ</dc:creator>
      <dc:date>2023-03-21T14:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: Trailing 6 months average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trailing-6-months-average/m-p/3144946#M112466</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;This is the results I would like to get.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 14:41:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trailing-6-months-average/m-p/3144946#M112466</guid>
      <dc:creator>PB_MZ</dc:creator>
      <dc:date>2023-03-21T14:41:58Z</dc:date>
    </item>
  </channel>
</rss>

