<?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: Rolling Average not including months with no data in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Average-not-including-months-with-no-data/m-p/1525216#M29839</link>
    <description>&lt;P&gt;did you try that&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;?- I fixed the -12 to be -3, but it doesn't provide the same or correct results as I understood&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="273436" data-lia-user-login="dBrand" class="lia-mention lia-mention-user"&gt;dBrand&lt;/a&gt;&amp;nbsp;to request it. I think yours is just a Rolling 3 month average template, but doesn't take into account missing months.&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;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Dec 2020 02:00:14 GMT</pubDate>
    <dc:creator>edhans</dc:creator>
    <dc:date>2020-12-01T02:00:14Z</dc:date>
    <item>
      <title>Rolling Average not including months with no data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Average-not-including-months-with-no-data/m-p/1524981#M29828</link>
      <description>&lt;P&gt;I am looking to create a measure that returns the Rolling Average of 3 months. But I do not want to have it include months that have no transactions. So, if months 1 and 3 have data, but not month 2, I would add up months 1 and 3 and divisde by 2, not 3. But if all three had data, then it would divide by three. I already have measures that return the totals for each month, and thought I could use that, but am puzzled out how to come up with the divisor. Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another approach I was trying, if the above has no solution, was to count the number of transactions for each mnth and then for those not equal to zero, come up with the months with a valuse and use that to count the months with data. But that is messy sounding and I still couldn't figure out how to do that either. Ugh.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 21:17:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Average-not-including-months-with-no-data/m-p/1524981#M29828</guid>
      <dc:creator>dBrand</dc:creator>
      <dc:date>2020-11-30T21:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Average not including months with no data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Average-not-including-months-with-no-data/m-p/1525046#M29834</link>
      <description>&lt;P&gt;Try this&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="273436" data-lia-user-login="dBrand" class="lia-mention lia-mention-user"&gt;dBrand&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;3 Mo Rolling Average =
VAR varCurrentSalesMonth =
    MAX( Sales[Date] )
VAR varCurrentMonth =
    MAXX(
        FILTER(
            'Date',
            'Date'[Date] = varCurrentSalesMonth
        ),
        'Date'[Month Year Sort]
    )
VAR varValidDateRanges =
    FILTER(
        ALL( 'Date' ),
        'Date'[Month Year Sort] &amp;lt;= varCurrentMonth
            &amp;amp;&amp;amp; 'Date'[Month Year Sort] &amp;gt;= varCurrentMonth - 2
    )
VAR varRolling3MonthsSales =
    CALCULATE(
        SUM( Sales[Sales] ),
        varValidDateRanges
    )
VAR varValidMonths =
    CALCULATE(
        DISTINCTCOUNT( 'Date'[Month Year Sort] ),
        FILTER(
            varValidDateRanges,
            CALCULATE(
                SUM( Sales[Sales] )
            )
                &amp;lt;&amp;gt; BLANK()
        )
    )
RETURN
    DIVIDE(
        varRolling3MonthsSales,
        varValidMonths,
        0
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It requires a date table. My Month Year Sort column is an integer in my date table that is YYYYMM, so 202001 for Jan, 202002 for Feb, etc. this gives me a good integer to move up/down by one month in the table by simpliy adding/subtracting 1. I also used it to count the months with data.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;You can see there is no data for feb, so the march value of 17 is the (18+16)/2 months, March and Jan.&lt;BR /&gt;Same for August. (9+7)/2 = 8 because there is no July 2020 numbers. But Nov is (7+9+10)/3 = 8.666, shown as 9 due to how I have my data formated.&lt;BR /&gt;&lt;BR /&gt;If you want to use my date table, &lt;A href="https://bit.ly/DateTableByEd" target="_self"&gt;here you go&lt;/A&gt;. Full instructions there for plopping that into Power Query. Just mark it as a date table once it loads.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 23:36:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Average-not-including-months-with-no-data/m-p/1525046#M29834</guid>
      <dc:creator>edhans</dc:creator>
      <dc:date>2020-11-30T23:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Average not including months with no data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Average-not-including-months-with-no-data/m-p/1525097#M29835</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="273436" data-lia-user-login="dBrand" class="lia-mention lia-mention-user"&gt;dBrand&lt;/a&gt;&amp;nbsp;AverageX can omit the months which have not data automatically. such as&lt;/P&gt;&lt;P&gt;=averagex(values(yearmonth),[measure])&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 00:22:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Average-not-including-months-with-no-data/m-p/1525097#M29835</guid>
      <dc:creator>wdx223_Daniel</dc:creator>
      <dc:date>2020-12-01T00:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Average not including months with no data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Average-not-including-months-with-no-data/m-p/1525167#M29838</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="273436" data-lia-user-login="dBrand" class="lia-mention lia-mention-user"&gt;dBrand&lt;/a&gt; , Try a formula like &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rolling 3 = divide( CALCULATE(sum(Sales[Sales]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date]),-12,MONTH)) ,&lt;BR /&gt;CALCULATE(distinctCOUNT('Date'[Month Year]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-12,MONTH), not(isblank((Sales[Sales])))))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the denominator is checking is data in there for numerator or not&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 01:28:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Average-not-including-months-with-no-data/m-p/1525167#M29838</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-12-01T01:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Average not including months with no data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Average-not-including-months-with-no-data/m-p/1525216#M29839</link>
      <description>&lt;P&gt;did you try that&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;?- I fixed the -12 to be -3, but it doesn't provide the same or correct results as I understood&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="273436" data-lia-user-login="dBrand" class="lia-mention lia-mention-user"&gt;dBrand&lt;/a&gt;&amp;nbsp;to request it. I think yours is just a Rolling 3 month average template, but doesn't take into account missing months.&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;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 02:00:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Average-not-including-months-with-no-data/m-p/1525216#M29839</guid>
      <dc:creator>edhans</dc:creator>
      <dc:date>2020-12-01T02:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Average not including months with no data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Average-not-including-months-with-no-data/m-p/1525260#M29843</link>
      <description>&lt;P&gt;I've heard that. But how does this know what three months I want? The filter on the page is set for the Month/year. Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 02:17:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Average-not-including-months-with-no-data/m-p/1525260#M29843</guid>
      <dc:creator>dBrand</dc:creator>
      <dc:date>2020-12-01T02:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Average not including months with no data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Average-not-including-months-with-no-data/m-p/1525265#M29844</link>
      <description>&lt;P&gt;I haven't tried yet, but you are correct in your understanding. I need to create some smaple data to test these, as I only have data for one month at the moment with the real data. I will post back once tested. Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 02:21:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Average-not-including-months-with-no-data/m-p/1525265#M29844</guid>
      <dc:creator>dBrand</dc:creator>
      <dc:date>2020-12-01T02:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Average not including months with no data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Average-not-including-months-with-no-data/m-p/1525268#M29845</link>
      <description>&lt;P&gt;Thanks. Will look to try this out. More code than I would have hoped is necessary for the solution, but hey, that's how coding goes.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 02:22:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Average-not-including-months-with-no-data/m-p/1525268#M29845</guid>
      <dc:creator>dBrand</dc:creator>
      <dc:date>2020-12-01T02:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Average not including months with no data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Average-not-including-months-with-no-data/m-p/1525275#M29846</link>
      <description>&lt;P&gt;What filter&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="273436" data-lia-user-login="dBrand" class="lia-mention lia-mention-user"&gt;dBrand&lt;/a&gt;&amp;nbsp;- I don't see that in your original request.&lt;BR /&gt;&lt;BR /&gt;However, my measure handles it without modification. I've selected march, and it is still returning the correct Jan-Mar average over 2 months since Feb is empty.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If that isn't what you need, can you please give us the&amp;nbsp;&lt;EM&gt;full&lt;/EM&gt; requirements with perhaps some data and screenshots?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to get good help fast. Help us help you.&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" rel="noopener" target="_blank"&gt;How to Get Your Question Answered Quickly&lt;/A&gt; - Give us a good and concise explanation&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" rel="noopener" target="_blank"&gt;How to provide sample data in the Power BI Forum&lt;/A&gt; - Provide data in a table format per the link. Provide expected output using a screenshot of Excel or other image. Do not provide a screenshot of the source data. I cannot paste an image into Power BI tables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 02:24:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Average-not-including-months-with-no-data/m-p/1525275#M29846</guid>
      <dc:creator>edhans</dc:creator>
      <dc:date>2020-12-01T02:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Average not including months with no data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Average-not-including-months-with-no-data/m-p/1525289#M29848</link>
      <description>&lt;P&gt;THanks for the quick reply. I will have to follow up with what you ask tomorrow (out of time today, sorry). But it's a date filter where they can select one month on the page. I really would prefer to do it with the simple command you have used. I just am not sure how it knows to only take 3 months into account, but I'm sure I'm missing something - I'm still figuring all this out.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 02:33:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Average-not-including-months-with-no-data/m-p/1525289#M29848</guid>
      <dc:creator>dBrand</dc:creator>
      <dc:date>2020-12-01T02:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Average not including months with no data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Average-not-including-months-with-no-data/m-p/1525369#M29852</link>
      <description>&lt;P&gt;Mixed up my replies. I will try your initial solution tomorrow, as that is what I was after. Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 03:18:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Average-not-including-months-with-no-data/m-p/1525369#M29852</guid>
      <dc:creator>dBrand</dc:creator>
      <dc:date>2020-12-01T03:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Average not including months with no data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Average-not-including-months-with-no-data/m-p/1526759#M29896</link>
      <description>&lt;P&gt;THis seems to work. THank you for the help! Wish they would make things like this easier. I had thought using Average() would be useful, but nothing is ever that easy. Thanks again!&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 14:59:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Average-not-including-months-with-no-data/m-p/1526759#M29896</guid>
      <dc:creator>dBrand</dc:creator>
      <dc:date>2020-12-01T14:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Average not including months with no data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Average-not-including-months-with-no-data/m-p/1526774#M29897</link>
      <description>&lt;P&gt;Glad I was able to help&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="273436" data-lia-user-login="dBrand" class="lia-mention lia-mention-user"&gt;dBrand&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;When I need an average, I often only use an Average* function about 70% of the time. Sometimes you have to manually get the numerator and denominator for special cases like this. It may be possible to use average or averagex here, but still a lot of filters to remove and reapply based on your 3 calendar month requirement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope your project goes smoothly!&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 15:04:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Average-not-including-months-with-no-data/m-p/1526774#M29897</guid>
      <dc:creator>edhans</dc:creator>
      <dc:date>2020-12-01T15:04:17Z</dc:date>
    </item>
  </channel>
</rss>

