<?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 for only one group in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-for-only-one-group/m-p/2001562#M44443</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="316566" data-lia-user-login="Jrose" class="lia-mention lia-mention-user"&gt;Jrose&lt;/a&gt; , Try with help from two measures&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Avg1= AVERAGEX( values('Table_1'[Year4]), CALCULATE(COUNT('Table_1'[person_id])))&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;m3YrAvg =calculate([Avg1],&lt;BR /&gt;FILTER(ALL('Table_1'[Year4]),&lt;BR /&gt;'Table_1'[Year4] &amp;lt;= MAX('Table_1'[Year4]) &amp;amp;&amp;amp;&lt;BR /&gt;'Table_1'[Year4] &amp;gt; (MAX('Table_1'[Year4])-3) &amp;amp;&amp;amp; 'Table_1'[group] = MAX('Table_1'[group]) &lt;BR /&gt;) )&lt;/P&gt;</description>
    <pubDate>Fri, 06 Aug 2021 06:16:29 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2021-08-06T06:16:29Z</dc:date>
    <item>
      <title>Rolling average for only one group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-for-only-one-group/m-p/2000884#M44422</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've looked through many similar posts and can't quite get to what I need.&lt;/P&gt;&lt;P&gt;So far there is a calculated column to convert the year to a numeric year&lt;/P&gt;&lt;P&gt;Year4 = value(right(Table_1[Year],4))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then a measure that calculates a three year moving average&lt;/P&gt;&lt;P&gt;m3YrAvg =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;AVERAGEX(&lt;/P&gt;&lt;P&gt;SUMMARIZE('Table_1','Table_1'[Year4],"Tot_AY_Ct", CALCULATE(COUNT('Table_1'[person_id])))&lt;BR /&gt;,[Tot_AY_Ct]),&lt;BR /&gt;FILTER(ALL('Table_1'[Year4]),&lt;BR /&gt;'Table_1'[Year4] &amp;lt;= MAX('Table_1'[Year4]) &amp;amp;&amp;amp;&lt;BR /&gt;'Table_1'[Year4] &amp;gt; (MAX('Table_1'[Year4])-3)&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works fine, but I would like it to work for only Group A.&amp;nbsp; I can use the filter pane, but it seems cumbersome on some visuals and I would rather it be filtered at the calculation.&amp;nbsp; I've tried adding it in the FILTER statement, but can't get it to work without error.&amp;nbsp; Haven't used DAX much, so just can't seem to come up with the right placement or syntax I guess.&lt;/P&gt;&lt;P&gt;Any suggestion is appreciated.&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>Thu, 05 Aug 2021 18:52:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-for-only-one-group/m-p/2000884#M44422</guid>
      <dc:creator>Jrose</dc:creator>
      <dc:date>2021-08-05T18:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average for only one group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-for-only-one-group/m-p/2001562#M44443</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="316566" data-lia-user-login="Jrose" class="lia-mention lia-mention-user"&gt;Jrose&lt;/a&gt; , Try with help from two measures&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Avg1= AVERAGEX( values('Table_1'[Year4]), CALCULATE(COUNT('Table_1'[person_id])))&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;m3YrAvg =calculate([Avg1],&lt;BR /&gt;FILTER(ALL('Table_1'[Year4]),&lt;BR /&gt;'Table_1'[Year4] &amp;lt;= MAX('Table_1'[Year4]) &amp;amp;&amp;amp;&lt;BR /&gt;'Table_1'[Year4] &amp;gt; (MAX('Table_1'[Year4])-3) &amp;amp;&amp;amp; 'Table_1'[group] = MAX('Table_1'[group]) &lt;BR /&gt;) )&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 06:16:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-for-only-one-group/m-p/2001562#M44443</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-08-06T06:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average for only one group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-for-only-one-group/m-p/2002541#M44466</link>
      <description>&lt;P&gt;Thanks for the suggestion.&amp;nbsp; Unfortunately, it's not working.&lt;/P&gt;&lt;P&gt;The first calculation for average is giving numbers way too low and I can't tell what it is trying to average across.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the second calculation anyway, and it won't recognize the table columns.&amp;nbsp; The list that pops up as I enter the table name only shows the calculated fields and measures.&amp;nbsp; I typed it anyway and get an error that says "A single value for column "group" cannot be determined.&amp;nbsp; I used MAX to see if it would at least clear the error, which it didn't, but it doesn't make sense in this context anyway&amp;nbsp; I need to be able to say something like&lt;/P&gt;&lt;P&gt;where group = "A".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The original calculation I have works, I would just like to be able to add what is in the filter pane to the calculation instead as I anticipate needing it for other metrics in the future.&lt;/P&gt;&lt;P&gt;I guess I'm not understanding why it insists on an aggregate rather than being able to filter (select) only records of a certain value.&amp;nbsp; And why in this calculation it doesn't want to recognize regular data columns.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 13:53:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-for-only-one-group/m-p/2002541#M44466</guid>
      <dc:creator>Jrose</dc:creator>
      <dc:date>2021-08-06T13:53:49Z</dc:date>
    </item>
  </channel>
</rss>

