<?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: Find Average Using Most Recent Date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-Average-Using-Most-Recent-Date/m-p/4283050#M169986</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="460868" data-lia-user-login="FreemanZ" class="lia-mention lia-mention-user"&gt;FreemanZ&lt;/a&gt;&amp;nbsp;the _table variable inside CALCULATETABLE won't be filtered by TODAY.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Nov 2024 05:27:13 GMT</pubDate>
    <dc:creator>AntrikshSharma</dc:creator>
    <dc:date>2024-11-14T05:27:13Z</dc:date>
    <item>
      <title>Find Average Using Most Recent Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-Average-Using-Most-Recent-Date/m-p/4282382#M169945</link>
      <description>&lt;P&gt;Hi, all.&lt;BR /&gt;&lt;BR /&gt;New to DAX (but with some database background) so have been struggling to solve a simple issue. I have a data model that tracks tournament results for chess players. Partial table structure noted below:&lt;BR /&gt;&lt;BR /&gt;dCalendar&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Date&lt;BR /&gt;&amp;nbsp; &amp;nbsp;...&lt;BR /&gt;&lt;BR /&gt;dMembers&lt;BR /&gt;&amp;nbsp; &amp;nbsp;MemberID&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Expiry&lt;BR /&gt;&amp;nbsp; &amp;nbsp;...&lt;BR /&gt;&lt;BR /&gt;fResults&lt;BR /&gt;&amp;nbsp; &amp;nbsp;ResultDate&lt;BR /&gt;&amp;nbsp; &amp;nbsp;MemberID&lt;BR /&gt;&amp;nbsp; &amp;nbsp;NewRating&lt;BR /&gt;&amp;nbsp; &amp;nbsp;...&lt;BR /&gt;&lt;BR /&gt;dCalendar and fResults are related by Date and ResultDate; dMembers and fResults are related by MemberID. For each uique MemberID in dMembers, there can be one or hundreds of entries in the fResults table--just depends how active that player is.&lt;BR /&gt;&lt;BR /&gt;I'm trying to calculate the average member rating using ONLY each member's MOST RECENT entry in the fResults table. I would like to restrict this calculation to only active members where dMembers[Expiry] is greater than today.&lt;BR /&gt;&lt;BR /&gt;I'm sure this is pretty starightforward, but the max(date) bit is throwing me off. Many thanks for any suggestions.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 18:51:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-Average-Using-Most-Recent-Date/m-p/4282382#M169945</guid>
      <dc:creator>LurkingDude</dc:creator>
      <dc:date>2024-11-13T18:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: Find Average Using Most Recent Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-Average-Using-Most-Recent-Date/m-p/4282407#M169948</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="847278" data-lia-user-login="LurkingDude" class="lia-mention lia-mention-user"&gt;LurkingDude&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For average you could do&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;CALCULATE ( AVERAGE ( fResults[Rating] ), dMembers[Expiry] &amp;gt;= TODAY () )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 19:25:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-Average-Using-Most-Recent-Date/m-p/4282407#M169948</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2024-11-13T19:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: Find Average Using Most Recent Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-Average-Using-Most-Recent-Date/m-p/4282437#M169950</link>
      <description>&lt;P&gt;Thanks for the response. Yes, this will calculate the average rating for all non-expired members. But it does not take the most-recent rating only from the results table--this is the challenge I am having.&lt;BR /&gt;&lt;BR /&gt;Each active member may have literally hundreds of entries in the fResults table, each entry with a rating. I need to calculate the average on ONLY each member's most-recent rating.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 19:40:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-Average-Using-Most-Recent-Date/m-p/4282437#M169950</guid>
      <dc:creator>LurkingDude</dc:creator>
      <dc:date>2024-11-13T19:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: Find Average Using Most Recent Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-Average-Using-Most-Recent-Date/m-p/4282449#M169951</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="847278" data-lia-user-login="LurkingDude" class="lia-mention lia-mention-user"&gt;LurkingDude&lt;/a&gt;&amp;nbsp;Define most recent, unless you have a column such as LastUpdateDate you can't quantify most recent.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 19:53:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-Average-Using-Most-Recent-Date/m-p/4282449#M169951</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2024-11-13T19:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: Find Average Using Most Recent Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-Average-Using-Most-Recent-Date/m-p/4282462#M169952</link>
      <description>&lt;P&gt;fResults[ResultDate] is the date of the most-recent rating update. This field is related to the Date field in dCalendar.&lt;BR /&gt;&lt;BR /&gt;Thanks again.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 19:58:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-Average-Using-Most-Recent-Date/m-p/4282462#M169952</guid>
      <dc:creator>LurkingDude</dc:creator>
      <dc:date>2024-11-13T19:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: Find Average Using Most Recent Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-Average-Using-Most-Recent-Date/m-p/4282471#M169954</link>
      <description>&lt;P&gt;hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="847278" data-lia-user-login="LurkingDude" class="lia-mention lia-mention-user"&gt;LurkingDude&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;try like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;measure =&lt;/P&gt;
&lt;P&gt;VAR _table =&lt;/P&gt;
&lt;P&gt;ADDCOLUMNS(&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; SUMMARIZE(&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fResults,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dMembers[MemberID],&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dMembers[Expiry]&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; ),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; "RecentDate",&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; CALCULATE(MAX(fResults[ResultDate]))&lt;/P&gt;
&lt;P&gt;)&lt;/P&gt;
&lt;P&gt;VAR _result =&lt;/P&gt;
&lt;P&gt;CALCULATE(&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; AVERAGE(fResults[NewRating]),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; TREATAS(&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CALCULATETABLE(&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _table,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dMembers[Expiry]&amp;gt;TODAY()&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;dMembers[MemberID],&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;dMembers[Expiry],&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;fResults[ResultDate]&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; )&lt;/P&gt;
&lt;P&gt;)&lt;/P&gt;
&lt;P&gt;RETURN _result&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 20:21:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-Average-Using-Most-Recent-Date/m-p/4282471#M169954</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2024-11-13T20:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: Find Average Using Most Recent Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-Average-Using-Most-Recent-Date/m-p/4282493#M169955</link>
      <description>&lt;P&gt;Whoa! No wonder I couldn't figure it out. LOL.&lt;BR /&gt;&lt;BR /&gt;Thanks for the response. I will try this out at first opportunity.&lt;BR /&gt;&lt;BR /&gt;So I understand what the code is doing, will the code line&amp;nbsp;&lt;SPAN&gt;CALCULATE(MAX(fResults[ResultDate])) iterate over _table and return the max date for EACH MemberID? I don't see where the grouping by MemberID is happening. Is it in the Summarize function? (I'm not too familiar with that one.)&lt;BR /&gt;&lt;BR /&gt;Thanks for helping me understand.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 20:31:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-Average-Using-Most-Recent-Date/m-p/4282493#M169955</guid>
      <dc:creator>LurkingDude</dc:creator>
      <dc:date>2024-11-13T20:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: Find Average Using Most Recent Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-Average-Using-Most-Recent-Date/m-p/4282497#M169957</link>
      <description>&lt;P&gt;hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="847278" data-lia-user-login="LurkingDude" class="lia-mention lia-mention-user"&gt;LurkingDude&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;yes, done with SUMMARIZE.&lt;/P&gt;
&lt;P&gt;the code is not verified, please come back and @me, in case of issue.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 20:41:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-Average-Using-Most-Recent-Date/m-p/4282497#M169957</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2024-11-13T20:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Find Average Using Most Recent Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-Average-Using-Most-Recent-Date/m-p/4283050#M169986</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="460868" data-lia-user-login="FreemanZ" class="lia-mention lia-mention-user"&gt;FreemanZ&lt;/a&gt;&amp;nbsp;the _table variable inside CALCULATETABLE won't be filtered by TODAY.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2024 05:27:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-Average-Using-Most-Recent-Date/m-p/4283050#M169986</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2024-11-14T05:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: Find Average Using Most Recent Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-Average-Using-Most-Recent-Date/m-p/4283065#M169988</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="236628" data-lia-user-login="AntrikshSharma" class="lia-mention lia-mention-user"&gt;AntrikshSharma&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;yes, indeed. thank you very much for pointing this out.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="847278" data-lia-user-login="LurkingDude" class="lia-mention lia-mention-user"&gt;LurkingDude&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;try like this instead:&lt;/P&gt;
&lt;DIV&gt;measure =&lt;/DIV&gt;
&lt;DIV&gt;VAR _table =&lt;/DIV&gt;
&lt;DIV&gt;ADDCOLUMNS(&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; SUMMARIZE(&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;CALCULATETABLE(&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;fResults,&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;dMembers[Expiry]&amp;gt;TODAY()&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ),&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dMembers[MemberID],&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dMembers[Expiry]&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; ),&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; "RecentDate",&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; CALCULATE(MAX(fResults[ResultDate]))&lt;/DIV&gt;
&lt;DIV&gt;)&lt;/DIV&gt;
&lt;DIV&gt;VAR _result =&lt;/DIV&gt;
&lt;DIV&gt;CALCULATE(&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; AVERAGE(fResults[NewRating]),&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; TREATAS(&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;_table&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;dMembers[MemberID],&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;dMembers[Expiry],&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;fResults[ResultDate]&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; )&lt;/DIV&gt;
&lt;DIV&gt;)&lt;/DIV&gt;
&lt;DIV&gt;RETURN _result&lt;/DIV&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt; &lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2024 05:38:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-Average-Using-Most-Recent-Date/m-p/4283065#M169988</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2024-11-14T05:38:55Z</dc:date>
    </item>
  </channel>
</rss>

