<?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: 6 Month Avg (excl. last month) with filters in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/6-Month-Avg-excl-last-month-with-filters/m-p/2628709#M76809</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="402095" data-lia-user-login="deepblue_m45" class="lia-mention lia-mention-user"&gt;deepblue_m45&lt;/a&gt; , Try like &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],eomonth(MAX('Date'[Date ]),-1) ,-12,MONTH)) &lt;/P&gt;</description>
    <pubDate>Sat, 09 Jul 2022 08:30:58 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2022-07-09T08:30:58Z</dc:date>
    <item>
      <title>6 Month Avg (excl. last month) with filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/6-Month-Avg-excl-last-month-with-filters/m-p/2628272#M76771</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I have written the below measure that will give me the average of the last 6 months, excluding the most recently completed month. This has worked very well when I'm looking at a scenario where there's 1 statistic to use.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;However, I'm looking at a situation where I need to sum up two types and it's not working as expected. For instance, I have a stacked column visual that is showing two customer types (w/ data labels for type 1, type 2, and grand total). When I apply this measure, it's giving me the average of both types individually (green cells) which is 2888. What I'm looking for is for the measure to average the grand total (yellow) which gives me 5777. I've tried many different ways and I can't quite get it. Any help would be appreciated!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&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;"6 Mo Avg (Excl Current) = 
CALCULATE(
    AVERAGE('AccountingTable'[Value]),
    DATESINPERIOD('Date Hierarchy'[Month Year],DATEADD(LASTDATE('Date Hierarchy'[Month Year]),-1,MONTH),-6,MONTH)
) "&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 17:31:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/6-Month-Avg-excl-last-month-with-filters/m-p/2628272#M76771</guid>
      <dc:creator>deepblue_m45</dc:creator>
      <dc:date>2022-07-08T17:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: 6 Month Avg (excl. last month) with filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/6-Month-Avg-excl-last-month-with-filters/m-p/2628709#M76809</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="402095" data-lia-user-login="deepblue_m45" class="lia-mention lia-mention-user"&gt;deepblue_m45&lt;/a&gt; , Try like &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],eomonth(MAX('Date'[Date ]),-1) ,-12,MONTH)) &lt;/P&gt;</description>
      <pubDate>Sat, 09 Jul 2022 08:30:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/6-Month-Avg-excl-last-month-with-filters/m-p/2628709#M76809</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-07-09T08:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: 6 Month Avg (excl. last month) with filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/6-Month-Avg-excl-last-month-with-filters/m-p/2629015#M76822</link>
      <description>&lt;P&gt;Hello:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please see attached file for one ay to obtain answer. I added date table and marked as date table. I hope this helps!&lt;/P&gt;&lt;P&gt;&lt;A title="Past 6 Month Avg" href="https://drive.google.com/file/d/1OW1L6auvvX9j13JmloMCTKRND_X1JLwz/view?usp=sharing" target="_self"&gt;https://drive.google.com/file/d/1OW1L6auvvX9j13JmloMCTKRND_X1JLwz/view?usp=sharing&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There ae a couple calculated columns but I will show main result below:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Jul 2022 01:37:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/6-Month-Avg-excl-last-month-with-filters/m-p/2629015#M76822</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-07-10T01:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: 6 Month Avg (excl. last month) with filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/6-Month-Avg-excl-last-month-with-filters/m-p/2638652#M77427</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="402095" data-lia-user-login="deepblue_m45" class="lia-mention lia-mention-user"&gt;deepblue_m45&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may try this solution.&lt;/P&gt;
&lt;P&gt;1 Create a Date column in ‘AccountingTable’ table&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Date =
VAR month_ =
    SWITCH (
        LEFT ( AccountingTable[Month], 3 ),
        "Jan", 1,
        "Feb", 2,
        "Mar", 3,
        "Apr", 4,
        "May", 5,
        "Jun", 6,
        "Jul", 7,
        "Aug", 8,
        "Sep", 9,
        "Oct", 10,
        "Nov", 11,
        "Dec", 12
    )
VAR year_ =
    2000 + RIGHT ( AccountingTable[Month], 2 )
RETURN
    DATE ( year_, month_, 1 )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2 Build relationship between ‘AccountingTable’ table and ‘Date Hierarchy’ table&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;6 Mo Avg (Excl Current) =
CALCULATE(
    AVERAGE('AccountingTable'[Total]),     //AVERAGE('AccountingTable'[Value])
    DATESINPERIOD('Date Hierarchy'[Month Year],DATEADD(LASTDATE('Date Hierarchy'[Month Year]),-1,MONTH),-6,MONTH)
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, you should see the Measure works.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Also, attached the pbix file as reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any post helps, then please consider&lt;STRONG&gt; Accept it as the solution&lt;/STRONG&gt; to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please let me know. Thanks a lot!&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 _ Caiyun&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 12:08:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/6-Month-Avg-excl-last-month-with-filters/m-p/2638652#M77427</guid>
      <dc:creator>v-cazheng-msft</dc:creator>
      <dc:date>2022-07-14T12:08:02Z</dc:date>
    </item>
  </channel>
</rss>

