<?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: Average Records Per Month Excluding the Unfiltered Maximum Month and Year in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Records-Per-Month-Excluding-the-Unfiltered-Maximum-Month/m-p/2697186#M81440</link>
    <description>&lt;P&gt;If CreatedMonthAndYear is a numeric column in YYYYMM format then I think the below should work&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Average monthly cases =
VAR maxDate =
    CALCULATE (
        MAX ( 'Data1'[CreatedMonthAndYear] ),
        ALL ( 'Data1'[CreatedMonthAndYear] )
    )
RETURN
    AVERAGEX (
        CALCULATETABLE (
            VALUES ( 'Data1'[CreatedMonth] ),
            'Data1'[CreatedMonthAndYear] &amp;lt; maxDate
        ),
        COUNTROWS ( 'Data1' )
    )&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 12 Aug 2022 10:30:57 GMT</pubDate>
    <dc:creator>johnt75</dc:creator>
    <dc:date>2022-08-12T10:30:57Z</dc:date>
    <item>
      <title>Average Records Per Month Excluding the Unfiltered Maximum Month and Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Records-Per-Month-Excluding-the-Unfiltered-Maximum-Month/m-p/2696000#M81348</link>
      <description>&lt;P&gt;Hi All&lt;BR /&gt;&lt;BR /&gt;I'm hoping this is a really easy one but as usual its driving me mad!!&lt;BR /&gt;&lt;BR /&gt;I have written the following measure which is working fine until I apply a slicer. I need to return the average number of records excluding the latest month and year in the entire data (the reson being the latest month and year is never fully populated). The only way I could think to do it is to "distinct count" the number of "month and year" and then minus 1, however, if I put a slicer to exclude the latest month and year I am then unnecessarily reducing the number of dates by one and therefore skewing the average.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Average Monthly Cases = Calculate(count(Data1[Number]),Data1[CreatedMonthAndYear] &amp;lt;= edate(max(Data1[CreatedMonthAndYear]),-1)) / (DISTINCTCOUNT(Data1[CreatedMonthAndYear])-1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I need to do something along the lines of exclude the "Ignore filter" MAX but I can't do it without getting an error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be great.&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;James&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2022 18:39:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Records-Per-Month-Excluding-the-Unfiltered-Maximum-Month/m-p/2696000#M81348</guid>
      <dc:creator>Topjacket</dc:creator>
      <dc:date>2022-08-11T18:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: Average Records Per Month Excluding the Unfiltered Maximum Month and Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Records-Per-Month-Excluding-the-Unfiltered-Maximum-Month/m-p/2697186#M81440</link>
      <description>&lt;P&gt;If CreatedMonthAndYear is a numeric column in YYYYMM format then I think the below should work&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Average monthly cases =
VAR maxDate =
    CALCULATE (
        MAX ( 'Data1'[CreatedMonthAndYear] ),
        ALL ( 'Data1'[CreatedMonthAndYear] )
    )
RETURN
    AVERAGEX (
        CALCULATETABLE (
            VALUES ( 'Data1'[CreatedMonth] ),
            'Data1'[CreatedMonthAndYear] &amp;lt; maxDate
        ),
        COUNTROWS ( 'Data1' )
    )&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 12 Aug 2022 10:30:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Records-Per-Month-Excluding-the-Unfiltered-Maximum-Month/m-p/2697186#M81440</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2022-08-12T10:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: Average Records Per Month Excluding the Unfiltered Maximum Month and Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Records-Per-Month-Excluding-the-Unfiltered-Maximum-Month/m-p/2711064#M82363</link>
      <description>&lt;P&gt;Hi Johnt75&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply and sorry for the slow response. I did try this but it was just returning a count of all data. I'm sure it was something I was doing wrong but unfortunately I had to complete this work last week so didn't manage to go any further with it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;James&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2022 22:53:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Records-Per-Month-Excluding-the-Unfiltered-Maximum-Month/m-p/2711064#M82363</guid>
      <dc:creator>Topjacket</dc:creator>
      <dc:date>2022-08-18T22:53:15Z</dc:date>
    </item>
  </channel>
</rss>

