<?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 last 3 rows in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-rows/m-p/2113709#M48397</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var Rolling Average= CALCULATE(Table[W-knee], FILTER(ALLSELECTED(Table[SPR]), ISONORAFTER( Table[SPR], MAX(Table[SPR]), asc)))&lt;BR /&gt;Return&amp;nbsp; (Rolling Average/ 3)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Mark this as a solution, if I answered your question. Kudos are always appreciated.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Mon, 04 Oct 2021 11:44:18 GMT</pubDate>
    <dc:creator>Tanushree_Kapse</dc:creator>
    <dc:date>2021-10-04T11:44:18Z</dc:date>
    <item>
      <title>Rolling average last 3 rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-rows/m-p/2113605#M48394</link>
      <description>&lt;P&gt;Hi, I'm new here and I need some help.&lt;/P&gt;&lt;P&gt;I would like to calculate a "W-kee" rolling average over the last 3 rows in the table example as below:&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;So the result should be ((1+4+1)/3=2), but I don't know what DAX formula I need to use.&lt;/P&gt;&lt;P&gt;I think I should use something based on nonblank rows for the W-kee column but I really have no glue.&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Oct 2021 10:54:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-rows/m-p/2113605#M48394</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-04T10:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average last 3 rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-rows/m-p/2113682#M48396</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this measure:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure=
Var _MaxL = calculate(max(table[SPR]),filter(table,table[W-kee]&amp;lt;&amp;gt;""))
Var _MinL = _MaxL-2
return
Calculate(avarage(table[W-kee]),filter(table,table[SPR]&amp;gt;=_MinL &amp;amp;&amp;amp;table[SPR]&amp;lt;=_MaxL ))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, please consider&amp;nbsp;&lt;STRONG&gt;accepting&lt;/STRONG&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;it as the solution&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;to help the other members find it more quickly.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Appreciate your Kudos!!&lt;/STRONG&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Oct 2021 11:39:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-rows/m-p/2113682#M48396</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2021-10-04T11:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average last 3 rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-rows/m-p/2113709#M48397</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var Rolling Average= CALCULATE(Table[W-knee], FILTER(ALLSELECTED(Table[SPR]), ISONORAFTER( Table[SPR], MAX(Table[SPR]), asc)))&lt;BR /&gt;Return&amp;nbsp; (Rolling Average/ 3)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Mark this as a solution, if I answered your question. Kudos are always appreciated.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 04 Oct 2021 11:44:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-rows/m-p/2113709#M48397</guid>
      <dc:creator>Tanushree_Kapse</dc:creator>
      <dc:date>2021-10-04T11:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average last 3 rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-rows/m-p/2113840#M48403</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Oct 2021 12:41:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-rows/m-p/2113840#M48403</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-04T12:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average last 3 rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-rows/m-p/2113852#M48405</link>
      <description>&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;&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>Mon, 04 Oct 2021 12:52:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-rows/m-p/2113852#M48405</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-04T12:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average last 3 rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-rows/m-p/2114979#M48450</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the format of [SPR] column?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Appreciate your Kudos!!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Oct 2021 23:48:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-rows/m-p/2114979#M48450</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2021-10-04T23:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average last 3 rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-rows/m-p/2115304#M48461</link>
      <description>&lt;P&gt;Whole number&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 05:56:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-rows/m-p/2115304#M48461</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-05T05:56:19Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average last 3 rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-rows/m-p/2115494#M48466</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you share your PBIX file with us (After removing sensetive data)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Appreciate your Kudos!!&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 07:25:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-rows/m-p/2115494#M48466</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2021-10-05T07:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average last 3 rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-rows/m-p/2155220#M49752</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, I can roughly understand your requirement, you can try this measure to get the expected result:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Rolling average =

var _lastrow=CALCULATE(MIN('Table'[SPR]),FILTER(ALL('Table'),[W-kee]=BLANK()&amp;amp;&amp;amp;[W-def]=BLANK()&amp;amp;&amp;amp;[W-mid]=BLANK()&amp;amp;&amp;amp;[W-att]=BLANK()))

return

CALCULATE(AVERAGE('Table'[W-kee]),FILTER(ALL('Table'),[SPR]&amp;lt;=_lastrow-1&amp;amp;&amp;amp;[SPR]&amp;gt;=_lastrow-3))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And you can get what you want, like this:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can download my test pbix file below&lt;/P&gt;
&lt;P&gt;Thank you very much!&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 _Robert Qin&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 08:13:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-rows/m-p/2155220#M49752</guid>
      <dc:creator>v-robertq-msft</dc:creator>
      <dc:date>2021-10-26T08:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average last 3 rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-rows/m-p/2155992#M49795</link>
      <description>&lt;P&gt;Great, that's the one I'm looking for.&lt;/P&gt;&lt;P&gt;Much appreciated!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 13:49:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-last-3-rows/m-p/2155992#M49795</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-26T13:49:24Z</dc:date>
    </item>
  </channel>
</rss>

