<?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: Conditional Rolling Average in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Rolling-Average/m-p/3442940#M130835</link>
    <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="321070" data-lia-user-login="yogeshk77" class="lia-mention lia-mention-user"&gt;yogeshk77&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Create calculated column.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;rank =
RANKX(
    FILTER(ALL(Expected),
    'Expected'[Team]=EARLIER('Expected'[Team])),[Reporting Sprint ID],,DESC)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Sum of Six Period Average =
IF(
    [rank] &amp;lt;=6,
    AVERAGEX(
        FILTER(ALL('Expected'),
        'Expected'[Team]=EARLIER('Expected'[Team])&amp;amp;&amp;amp;
        'Expected'[rank]&amp;gt;=EARLIER('Expected'[rank])&amp;amp;&amp;amp;'Expected'[rank]&amp;lt;=EARLIER('Expected'[rank])+5),[Story_Points])

)&lt;/LI-CODE&gt;
&lt;P&gt;2. Result:&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;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
    <pubDate>Fri, 22 Sep 2023 11:42:47 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-09-22T11:42:47Z</dc:date>
    <item>
      <title>Conditional Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Rolling-Average/m-p/3439967#M130635</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I have below mentioned Power BI table structure Table &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;WeightedVel&lt;/STRONG&gt; table contains below columns &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;“Team_10202” as a String Data type &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;“Reporting Sprint ID” as an Integer Data type &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;“Story_Points_10004” as a Decimal Data type &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now, I need a calculated column in this table to get average of last six “Story_Points_10004”, ordered by “Reporting Sprint ID”, grouped by “Team_10202”&lt;BR /&gt;Ensure you include the value of the current row in this calculation&lt;BR /&gt;&lt;BR /&gt;For e.g. if the data is like this -&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The output should be like this -&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2023 12:51:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Rolling-Average/m-p/3439967#M130635</guid>
      <dc:creator>yogeshk77</dc:creator>
      <dc:date>2023-09-20T12:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Rolling-Average/m-p/3440005#M130639</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="321070" data-lia-user-login="yogeshk77" class="lia-mention lia-mention-user"&gt;yogeshk77&lt;/a&gt;&amp;nbsp;Should be:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column = 
  VAR __Team = [Learnosity_Team_10202]
  VAR __Sprint = [Reporting Sprint ID]
  VAR __Sprints = SELECTCOLUMNS(FILTER('Table', [Learnosity_Team_10202] = __Team &amp;amp;&amp;amp; [Reporting Sprint ID] &amp;lt;= __Sprint), "__SprintID", [Reporting Sprint ID])
  VAR __SprintsText = CONCATENATEX( __Sprints, [__SprintID], "|", [__SprintID], DESC)
  VAR __Table = 
    ADDCOLUMNS(
      GENERATESERIES( 1, COUNTROWS(__Sprints), 1 ),
      "__SprintID", PATHITEM(__SprintsText, [Value])
    )
  VAR __FinalSprints = FILTER(__Table, [Value] &amp;lt;= 6)
  VAR __Result = AVERAGEX( FILTER('Table', [Reporting Sprint ID] IN __FinalSprints), [Sum of Story_Points_10004)
RETURN
  __Result
  &lt;/LI-CODE&gt;
&lt;P&gt;Quite possible that you will get some kind of error complaining about text vs. number. Also, couldn't test this so the probability of a syntax error is fairly high. If you provide your sample data as text, could test this in a PBIX file and provide the PBIX file to you.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2023 13:10:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Rolling-Average/m-p/3440005#M130639</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2023-09-20T13:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Rolling-Average/m-p/3442567#M130814</link>
      <description>&lt;P&gt;You can check &lt;A href="https://drive.google.com/file/d/1LLt6K0R1jFs8XcVorlQXjzuggYf2_Oj0/view?usp=drive_link" target="_self"&gt;this file&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I Need a calculated column in the table called "Data", which shows the output in the below table called "Expected Output"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2023 07:42:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Rolling-Average/m-p/3442567#M130814</guid>
      <dc:creator>yogeshk77</dc:creator>
      <dc:date>2023-09-22T07:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Rolling-Average/m-p/3442940#M130835</link>
      <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="321070" data-lia-user-login="yogeshk77" class="lia-mention lia-mention-user"&gt;yogeshk77&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Create calculated column.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;rank =
RANKX(
    FILTER(ALL(Expected),
    'Expected'[Team]=EARLIER('Expected'[Team])),[Reporting Sprint ID],,DESC)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Sum of Six Period Average =
IF(
    [rank] &amp;lt;=6,
    AVERAGEX(
        FILTER(ALL('Expected'),
        'Expected'[Team]=EARLIER('Expected'[Team])&amp;amp;&amp;amp;
        'Expected'[rank]&amp;gt;=EARLIER('Expected'[rank])&amp;amp;&amp;amp;'Expected'[rank]&amp;lt;=EARLIER('Expected'[rank])+5),[Story_Points])

)&lt;/LI-CODE&gt;
&lt;P&gt;2. Result:&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;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2023 11:42:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Rolling-Average/m-p/3442940#M130835</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-09-22T11:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Rolling-Average/m-p/3449727#M131366</link>
      <description>&lt;P&gt;Thank you.. In the stand alone test PBI this works, but in practical I have multiple other teams and looks like due to that combination the rank function is not working as expected.&lt;BR /&gt;&lt;BR /&gt;Here's the result from my actual PBI&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>Wed, 27 Sep 2023 12:22:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Rolling-Average/m-p/3449727#M131366</guid>
      <dc:creator>yogeshk77</dc:creator>
      <dc:date>2023-09-27T12:22:48Z</dc:date>
    </item>
  </channel>
</rss>

