<?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: finding max of date from filtered rows of table visual in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/finding-max-of-date-from-filtered-rows-of-table-visual/m-p/4001824#M155960</link>
    <description>&lt;P&gt;Hie Thanks for your reply and efforts that you put in. Really appreciate it., but unluckily the solution is not working as expected., I will simplify my question in another new post.&lt;/P&gt;</description>
    <pubDate>Thu, 20 Jun 2024 11:16:08 GMT</pubDate>
    <dc:creator>aatish178</dc:creator>
    <dc:date>2024-06-20T11:16:08Z</dc:date>
    <item>
      <title>finding max of date from filtered rows of table visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/finding-max-of-date-from-filtered-rows-of-table-visual/m-p/4000051#M155780</link>
      <description>&lt;P&gt;Hi All, I have 2 tables, table 1 consisting of only single field as shown below:&lt;/P&gt;&lt;P&gt;DateForFiltering&lt;BR /&gt;2024-07-07&lt;BR /&gt;2022-05-26&lt;BR /&gt;2022-05-25&lt;BR /&gt;2021-12-13&lt;BR /&gt;2021-12-12&lt;BR /&gt;2021-12-01&lt;BR /&gt;2021-11-30&lt;BR /&gt;2021-11-29&lt;BR /&gt;2021-10-01&lt;BR /&gt;and there is &lt;STRONG&gt;always one select option enabled&lt;/STRONG&gt; for this date in slicer.&lt;/P&gt;&lt;P&gt;Table2 has below data:&lt;/P&gt;&lt;P&gt;EmpNo CompCode CompNo&amp;nbsp; &amp;nbsp; &amp;nbsp; Valid From&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Valid To&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Salary&lt;BR /&gt;257298&amp;nbsp; &amp;nbsp; &amp;nbsp; BE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10035&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2020-06-05&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2021-11-29&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2369&lt;BR /&gt;257298&amp;nbsp; &amp;nbsp; &amp;nbsp; BE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10035&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2021-11-30&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2021-12-12&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2370&lt;BR /&gt;257298&amp;nbsp; &amp;nbsp; &amp;nbsp; BE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10035&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2021-12-13&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2022-05-25&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2433&lt;BR /&gt;257298&amp;nbsp; &amp;nbsp; &amp;nbsp; BE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10035&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2022-05-26&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;9999-12-31&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2311&lt;BR /&gt;257298&amp;nbsp; &amp;nbsp; &amp;nbsp; BE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 21174&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2021-11-12&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2022-02-02&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1976&lt;BR /&gt;257298&amp;nbsp; &amp;nbsp; &amp;nbsp; BE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 21174&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2022-02-03&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;9999-12-31&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2298&lt;BR /&gt;Here for each EmpNo,CompCode and CompNo unique combination I have to find out the latest version of data based on max of valid to date., but this valid to date column should only show those dates which are &lt;STRONG&gt;less than or equal to&lt;/STRONG&gt; selected date from&amp;nbsp;DateForFiltering field., and the dates which are &lt;STRONG&gt;greater&lt;/STRONG&gt; than&amp;nbsp;DateForFiltering , it should show it as &lt;STRONG&gt;Blank&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;I have achieved date filtering using below measure:&lt;/P&gt;&lt;P&gt;Valid To filter date=&lt;BR /&gt;VAR DateCheck =&lt;BR /&gt;CALCULATE (&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SELECTEDVALUE ( Table1[DateForFiltering] )&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;RETURN&lt;BR /&gt;&amp;nbsp; &amp;nbsp; IF (&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MAX ('Table2'[Valid To] ) &amp;lt;= DateCheck,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MAX (''Table2'[Valid To]&amp;nbsp;),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; BLANK()&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;)&lt;BR /&gt;The 2nd condition is &lt;STRONG&gt;Valid From date &amp;lt;= DateForFiltering&lt;/STRONG&gt;.&lt;BR /&gt;I have achieved this using measure on salary as below:&lt;BR /&gt;CALCULATE(AVERAGE('Table2'[Salary]),FILTER('Table2',&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Table2'[Valid From]&amp;lt;=MAX(Table1[DateForFiltering])))&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;Now table visual will get filtered as per different selected date from&amp;nbsp;DateForFiltering column. Till here the solution is working fine.,&lt;BR /&gt;Now from that filtered result., again I want to find out the max of valid to date for each&amp;nbsp;EmpNo,CompCode and CompNo combination., but I am unable to achieve it dynamically., because the &lt;STRONG&gt;filtered result is still considering 9999-12-31&lt;/STRONG&gt; as max of valid to date.,&lt;BR /&gt;Lets understand this with example., I have selected 2021-12-13 from the DateForFiltering column., hence table visual will automatiically show me below result:&lt;BR /&gt;EmpNo&amp;nbsp; &amp;nbsp; CompCode CompNo&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Valid From&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Valid To&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Salary&lt;BR /&gt;257298&amp;nbsp; &amp;nbsp; &amp;nbsp; BE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10035&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2020-06-05&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2021-11-29&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2369&lt;BR /&gt;257298&amp;nbsp; &amp;nbsp; &amp;nbsp; BE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10035&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2021-11-30&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2021-12-12&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2370&lt;BR /&gt;257298&amp;nbsp; &amp;nbsp; &amp;nbsp; BE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10035&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2021-12-13&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2022-05-25&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2433&lt;BR /&gt;257298&amp;nbsp; &amp;nbsp; &amp;nbsp; BE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 21174&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2021-11-12&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2022-02-02&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1976&lt;BR /&gt;this is the result of ALL VERSION., that i am able to achieve.,&lt;BR /&gt;Now from this filtered result., I want to find out&lt;STRONG&gt; Latest Version&lt;/STRONG&gt; for EmpNo, CompCode,CompNo unique combination based on &lt;STRONG&gt;Max of Valid To Date(2022-05-25 and 2022-02-02&lt;/STRONG&gt;., this i had shown in above table for &lt;STRONG&gt;understanding purpose.&lt;/STRONG&gt;, but in real it will display &lt;STRONG&gt;as blank&lt;/STRONG&gt; as per the mentioned logic)., but power bi still considering 9999-12-31 as the max valid to date.&lt;BR /&gt;Can someone plz help me achieving this.&lt;BR /&gt;In Short , once I filtered Table2 by Table1 DateFor Filtering., and whatever result i got., that result should get consider to calculate max of valid to date., hence the final result would be&lt;BR /&gt;EmpNo&amp;nbsp; &amp;nbsp; &amp;nbsp;CompCode&amp;nbsp; &amp;nbsp; &amp;nbsp;CompNo&amp;nbsp; &amp;nbsp; &amp;nbsp;Valid From&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Valid To&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Salary&lt;BR /&gt;257298&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10035&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2021-12-13&amp;nbsp; &amp;nbsp; &amp;nbsp;2022-05-25(will be shown as blank)&amp;nbsp; &amp;nbsp; &amp;nbsp; 2433&lt;BR /&gt;257298&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BE&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 21174&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2021-11-12&amp;nbsp; &amp;nbsp; &amp;nbsp;2022-02-02(will be shown as blank)&amp;nbsp; &amp;nbsp; &amp;nbsp; 1976&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Plz help if possible., thanks in advance&lt;/P&gt;&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="19851" data-lia-user-login="Ashish_Mathur" class="lia-mention lia-mention-user"&gt;Ashish_Mathur&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="219243" data-lia-user-login="quantumudit" class="lia-mention lia-mention-user"&gt;quantumudit&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="523696" data-lia-user-login="quantumudit1" class="lia-mention lia-mention-user"&gt;quantumudit1&lt;/a&gt;&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/426215" target="_blank"&gt;@gmsamborn&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/650040" target="_blank"&gt;@v-jialongy-msft&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 11:43:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/finding-max-of-date-from-filtered-rows-of-table-visual/m-p/4000051#M155780</guid>
      <dc:creator>aatish178</dc:creator>
      <dc:date>2024-06-19T11:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: finding max of date from filtered rows of table visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/finding-max-of-date-from-filtered-rows-of-table-visual/m-p/4000738#M155883</link>
      <description>&lt;P&gt;DO NOT use dates like&amp;nbsp;&lt;SPAN&gt;9999-12-31 - they will cause your calendar table to have over 2 MILLION rows, for no good reason.&amp;nbsp; Use Blanks instead.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 21:22:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/finding-max-of-date-from-filtered-rows-of-table-visual/m-p/4000738#M155883</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-06-19T21:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: finding max of date from filtered rows of table visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/finding-max-of-date-from-filtered-rows-of-table-visual/m-p/4001214#M155927</link>
      <description>&lt;P&gt;There is a need to show this date in order for users to understand the version is still valid in the market... Hence it will be the latest version., my requirement is if user selects some less date from Date for filtering column and once he gets filtered data in table visual having dates other than 9999-12-31, from that date range the maximum of date should get calculated. That is something I am not able to achieve&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 06:09:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/finding-max-of-date-from-filtered-rows-of-table-visual/m-p/4001214#M155927</guid>
      <dc:creator>aatish178</dc:creator>
      <dc:date>2024-06-20T06:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: finding max of date from filtered rows of table visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/finding-max-of-date-from-filtered-rows-of-table-visual/m-p/4001475#M155942</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="724507" data-lia-user-login="aatish178" class="lia-mention lia-mention-user"&gt;aatish178&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;First of all, many thanks to&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp; for your very quick and effective replies.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Based on my testing, please &lt;SPAN&gt;try the following methods again:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1.Create the simple tables.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2.Create the new measure to filter the Valid to date and max of date.&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Max Valid To Date = 
VAR sel_date = SELECTEDVALUE(Table1[DateForFiltering])
var t2_date = SELECTEDVALUE(Table2[Valid To])
VAR result = CALCULATE(MAX(Table2[Valid To]), FILTER(ALLEXCEPT(Table2, Table2[Combination]), Table2[Valid To] &amp;lt;= sel_date &amp;amp;&amp;amp; Table2[Valid From] &amp;lt;= sel_date))
RETURN
IF(t2_date = result,result,BLANK())
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;3.Drag the Table1 date field into the slicer visual.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;4.Select the 2022-05-25. The result is shown below.&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;Best Regards,&lt;/P&gt;
&lt;P&gt;Wisdom Wu&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 08:14:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/finding-max-of-date-from-filtered-rows-of-table-visual/m-p/4001475#M155942</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-20T08:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: finding max of date from filtered rows of table visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/finding-max-of-date-from-filtered-rows-of-table-visual/m-p/4001824#M155960</link>
      <description>&lt;P&gt;Hie Thanks for your reply and efforts that you put in. Really appreciate it., but unluckily the solution is not working as expected., I will simplify my question in another new post.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 11:16:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/finding-max-of-date-from-filtered-rows-of-table-visual/m-p/4001824#M155960</guid>
      <dc:creator>aatish178</dc:creator>
      <dc:date>2024-06-20T11:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: finding max of date from filtered rows of table visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/finding-max-of-date-from-filtered-rows-of-table-visual/m-p/4001928#M156798</link>
      <description>&lt;P&gt;&lt;FONT size="2"&gt;Hi All, I have 2 tables &lt;STRONG&gt;without active relationship&lt;/STRONG&gt; with each other. Table 1 has below data.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Table 1:&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;IntervalDate&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;2024-07-07&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;2022-05-26&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;2022-05-25&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;2021-12-13&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;2021-12-12&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;2021-12-01&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;2021-11-30&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;2021-11-29&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;2021-10-01&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;this date is used in slicer with setting of &lt;STRONG&gt;single select.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;Table2:&lt;/STRONG&gt; It has different versions of Product No based on valid from and valid to date., when one version closes, another version starts on very next day.,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;and my goal is to find out the latest version among it for each &lt;STRONG&gt;Product No combination&lt;/STRONG&gt;.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Product No&amp;nbsp; &amp;nbsp;Valid From&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Valid To&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ProductQty&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;257298&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2020-06-05&amp;nbsp; &amp;nbsp; &amp;nbsp;2021-11-29&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;100&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;257298&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2021-11-30&amp;nbsp; &amp;nbsp; &amp;nbsp;2021-12-12&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;150&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;257298&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2021-12-13&amp;nbsp; &amp;nbsp; &amp;nbsp;2022-05-25&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;175&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;257298&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2022-05-26&amp;nbsp; &amp;nbsp; &amp;nbsp;9999-12-31&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;200&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;131278&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2021-12-10&amp;nbsp; &amp;nbsp; &amp;nbsp;2022-12-30&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 500&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;131278&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2022-12-31&amp;nbsp; &amp;nbsp; &amp;nbsp;9999-12-31&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;350&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Here I have 2 uniqe products so the latest version of it based on max of valid to date would be:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Product No&amp;nbsp; &amp;nbsp;Valid From&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Valid To&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ProductQty&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;257298&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2022-05-26&amp;nbsp; &amp;nbsp; &amp;nbsp;9999-12-31&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;200&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;131278&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2022-12-31&amp;nbsp; &amp;nbsp; &amp;nbsp;9999-12-31&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;350&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Till here I am able to achive the output., The real problem is coming when the &lt;STRONG&gt;Table 2 &lt;/STRONG&gt;is getting&lt;STRONG&gt; filtered &lt;/STRONG&gt;by the&lt;STRONG&gt; IntervalDate &lt;/STRONG&gt;of&lt;STRONG&gt; Table 1&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Table 2 should only show the data having&lt;STRONG&gt; valid from date &amp;lt; = selected date of Table 1.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;To achieve that I had used calculated measure on ProductQty Column as below:&lt;/FONT&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;Product qty =&lt;/SPAN&gt; &lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;AVERAGE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Table2'&lt;/SPAN&gt;&lt;SPAN&gt;[ProductQty]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Table2'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;'Table2'&lt;/SPAN&gt;&lt;STRONG&gt;[Valid From]&lt;/STRONG&gt;&lt;SPAN&gt;&amp;lt;=&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Table1&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;STRONG&gt;IntervalDate &lt;/STRONG&gt;]&lt;/SPAN&gt;&lt;SPAN&gt;)))&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;So if I select IntervalDate as &lt;STRONG&gt;2022-05-25,&amp;nbsp;&lt;/STRONG&gt;I wll get below output based on filtering(I am able to achieve this)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;&lt;FONT size="2"&gt;Product No&amp;nbsp; &amp;nbsp;Valid From&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Valid To&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ProductQty&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;257298&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2020-06-05&amp;nbsp; &amp;nbsp; &amp;nbsp;2021-11-29&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;100&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;257298&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2021-11-30&amp;nbsp; &amp;nbsp; &amp;nbsp;2021-12-12&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;150&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;257298&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2021-12-13&amp;nbsp; &amp;nbsp; &amp;nbsp;2022-05-25&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;175&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;131278&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2021-12-10&amp;nbsp; &amp;nbsp; &amp;nbsp;2022-12-30&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;500&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Now from this result the latest version should get calculated based on Max of valid to date(2022-05-25 and 2022-12-30 for each Product No.) that is below final output:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Product No&amp;nbsp; &amp;nbsp;Valid From&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Valid To&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ProductQty&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;257298&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2021-12-13&amp;nbsp; &amp;nbsp; &amp;nbsp;2022-05-25&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;175&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;131278&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2021-12-10&amp;nbsp; &amp;nbsp; &amp;nbsp;2022-12-30&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;500&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;But power bi is still considering 9999-12-31 as the max of valid to date. This dynamic filtering I am not able to achieve from already filtered result.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;To understand it more., lets take one more example. IntervalDate: &lt;STRONG&gt;2021-12-12, &lt;/STRONG&gt;the filtered data would be:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Product No&amp;nbsp; &amp;nbsp;Valid From&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Valid To&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ProductQty&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;257298&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2020-06-05&amp;nbsp; &amp;nbsp; &amp;nbsp;2021-11-29&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;100&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;257298&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2021-11-30&amp;nbsp; &amp;nbsp; &amp;nbsp;2021-12-12&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;150&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;131278&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2021-12-10&amp;nbsp; &amp;nbsp; &amp;nbsp;2022-12-30&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 500&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Now from this result PBI should calculate Max of Valid To and should show below rows as final result&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Product No&amp;nbsp; &amp;nbsp;Valid From&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Valid To&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ProductQty&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;257298&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2021-11-30&amp;nbsp; &amp;nbsp; &amp;nbsp;2021-12-12&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;150&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;131278&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2021-12-10&amp;nbsp; &amp;nbsp; &amp;nbsp;2022-12-30&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 500&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Can someone plz help me achieving this dynamic filtering based on already filtered data. Thanks in advance.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="19851" data-lia-user-login="Ashish_Mathur" class="lia-mention lia-mention-user"&gt;Ashish_Mathur&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="219243" data-lia-user-login="quantumudit" class="lia-mention lia-mention-user"&gt;quantumudit&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="523696" data-lia-user-login="quantumudit1" class="lia-mention lia-mention-user"&gt;quantumudit1&lt;/a&gt;&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/667910" target="_blank"&gt;@v-huijiey-msft&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/426215" target="_blank" rel="noopener"&gt;@gmsamborn&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/650040" target="_blank" rel="noopener"&gt;@v-jialongy-msft&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/669614" target="_blank"&gt;@v-kaiyue-msft&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/100342" target="_blank"&gt;@lbendlin&lt;/A&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 20 Jun 2024 12:12:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/finding-max-of-date-from-filtered-rows-of-table-visual/m-p/4001928#M156798</guid>
      <dc:creator>aatish178</dc:creator>
      <dc:date>2024-06-20T12:12:01Z</dc:date>
    </item>
    <item>
      <title>Re: finding max of date from filtered rows of table visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/finding-max-of-date-from-filtered-rows-of-table-visual/m-p/4001947#M155983</link>
      <description>&lt;P&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Desktop/Dynamic-filtering-of-table-visual-in-power-bi-based-on-selection/m-p/4001928#M1276317" target="_blank"&gt;Dynamic filtering of table visual in power bi base... - Microsoft Fabric Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Plz check this&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 12:21:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/finding-max-of-date-from-filtered-rows-of-table-visual/m-p/4001947#M155983</guid>
      <dc:creator>aatish178</dc:creator>
      <dc:date>2024-06-20T12:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: finding max of date from filtered rows of table visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/finding-max-of-date-from-filtered-rows-of-table-visual/m-p/4003195#M156799</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="724507" data-lia-user-login="aatish178" class="lia-mention lia-mention-user"&gt;aatish178&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on your description, I used the following sample data:&lt;/P&gt;
&lt;P&gt;table1:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;table2:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;I've created a measure using the following DAX expression to achieve the desired result you were expecting above:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure2 =
VAR _seleted_date =
    SELECTEDVALUE ( Table1[IntervalDate] )
VAR _table =
    FILTER ( ALL ( Table2 ), 'Table2'[Valid From] &amp;lt;= _seleted_date )
VAR _table1 =
    SUMMARIZE (
        _table,
        Table2[Product No ],
        "maxValid from",
            VAR _current_No =
                SELECTEDVALUE ( Table2[Product No ] )
            VAR _max_date =
                MAXX (
                    FILTER ( _table, 'Table2'[Product No ] = _current_No ),
                    'Table2'[Valid From]
                )
            RETURN
                _max_date,
        "maxValid to",
            VAR _current_No =
                SELECTEDVALUE ( Table2[Product No ] )
            VAR _max_date =
                MAXX (
                    FILTER ( _table, 'Table2'[Product No ] = _current_No ),
                    'Table2'[Valid To]
                )
            RETURN
                _max_date,
        "qty",
            VAR _current_No =
                SELECTEDVALUE ( Table2[Product No ] )
            RETURN
                MAXX (
                    FILTER ( _table, 'Table2'[Product No ] = _current_No ),
                    'Table2'[ProductQty]
                )
    )
RETURN
    IF (
        SELECTEDVALUE ( Table2[Valid From] )
            IN SELECTCOLUMNS ( _table1, [maxValid from] ),
        MAXX (
            FILTER (
                _table1,
                'Table2'[Product No ] = SELECTEDVALUE ( Table2[Product No ] )
            ),
            [qty]
        ),
        BLANK ()
    )
&lt;/LI-CODE&gt;
&lt;P&gt;Here's what you can expect:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;I looked at your DAX expression and you seem to want the qty average for each Product No at 'Table2'[Valid From]&amp;lt;=MAX(Table1[IntervalDate], then you can use the following DAX expression:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MEASURE =
VAR _seleted_date =
    SELECTEDVALUE ( Table1[IntervalDate] )
VAR _table =
    FILTER ( ALL ( Table2 ), 'Table2'[Valid From] &amp;lt;= _seleted_date )
VAR _table1 =
    SUMMARIZE (
        _table,
        Table2[Product No ],
        "maxValid from",
            VAR _current_No =
                SELECTEDVALUE ( Table2[Product No ] )
            VAR _max_date =
                MAXX (
                    FILTER ( _table, 'Table2'[Product No ] = _current_No ),
                    'Table2'[Valid From]
                )
            RETURN
                _max_date,
        "maxValid to",
            VAR _current_No =
                SELECTEDVALUE ( Table2[Product No ] )
            VAR _max_date =
                MAXX (
                    FILTER ( _table, 'Table2'[Product No ] = _current_No ),
                    'Table2'[Valid To]
                )
            RETURN
                _max_date,
        "qty",
            VAR _current_No =
                SELECTEDVALUE ( Table2[Product No ] )
            RETURN
                AVERAGEX (
                    FILTER ( _table, 'Table2'[Product No ] = _current_No ),
                    'Table2'[ProductQty]
                )
    )
RETURN
    IF (
        SELECTEDVALUE ( Table2[Valid From] )
            IN SELECTCOLUMNS ( _table1, [maxValid from] ),
        MAXX (
            FILTER (
                _table1,
                'Table2'[Product No ] = SELECTEDVALUE ( Table2[Product No ] )
            ),
            [qty]
        ),
        BLANK ()
    )
&lt;/LI-CODE&gt;
&lt;P&gt;Here are the results:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;I've provided the PBIX file used this time below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-Get-Your-Question-Answered-Quickly%2Fba-p%2F38490&amp;amp;data=05%7C02%7Cv-jianpengli%40microsoft.com%7Cd9552f18a0c94a7564f308dc188bf35e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638412236574903368%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=3jxUE%2BTNC8dS4DIhPphEB3NA%2BK94pwURGHu%2BXC4eezw%3D&amp;amp;reserved=0" target="_blank"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Jianpeng Li&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2024 03:37:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/finding-max-of-date-from-filtered-rows-of-table-visual/m-p/4003195#M156799</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-21T03:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: finding max of date from filtered rows of table visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/finding-max-of-date-from-filtered-rows-of-table-visual/m-p/4004009#M156802</link>
      <description>&lt;P&gt;Hi, Thanks for your support :), but the solution is failing at last step:&lt;/P&gt;&lt;PRE&gt;RETURN
    IF (
        SELECTEDVALUE ( Table2[Valid From] )
            IN SELECTCOLUMNS ( _table1, [maxValid from] ),
        MAXX (
            FILTER (
                _table1,
                'Table2'[Product No ] = SELECTEDVALUE ( Table2[Product No ] )
            ),
            [qty]
        ),
        BLANK ()
    )&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here the moment I am selecting valid from, less than the current valid from date., it is showing as blank.,&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;My expectation is for selected valid from date from slicer., if it is fitting in IntervalDate Criteria, then table visual show that entry as well., but here it is showing blank&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you plz help me know hjow can i fix it&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2024 11:51:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/finding-max-of-date-from-filtered-rows-of-table-visual/m-p/4004009#M156802</guid>
      <dc:creator>aatish178</dc:creator>
      <dc:date>2024-06-21T11:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: finding max of date from filtered rows of table visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/finding-max-of-date-from-filtered-rows-of-table-visual/m-p/4005969#M156806</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="724507" data-lia-user-login="aatish178" class="lia-mention lia-mention-user"&gt;aatish178&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Based on my testing again, please &lt;SPAN&gt;try the following methods again:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1.Create the new measure to filter the Valid from date.&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Latest result = 
VAR sel_date = SELECTEDVALUE(Table1[IntervalDate])
var t2_date = SELECTEDVALUE(Table2[Valid From])
VAR result = CALCULATE(SELECTEDVALUE(Table2[Valid From]), FILTER(Table2, Table2[Valid From] &amp;lt;= sel_date))
RETURN
IF(t2_date = result, 1, 0)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;2.Drag the measure into the filters pane. Enter the show items is 1.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;3.Create the new measure to filter the max date.&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Max Valid Date = 
VAR sel_date = SELECTEDVALUE(Table1[IntervalDate])
var t2_date = SELECTEDVALUE(Table2[Valid From])
VAR result = CALCULATE(MAX(Table2[Valid From]), FILTER(ALLEXCEPT(Table2, Table2[Product No]), Table2[Latest result] = 1))
RETURN
IF(t2_date = result, 1, 0)
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;4.Drag the measure into the filters pane. Enter the show items is 1.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;5.If you select the valid from date, the date should be contained in the filter table visual.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Wisdom Wu&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2024 01:53:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/finding-max-of-date-from-filtered-rows-of-table-visual/m-p/4005969#M156806</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-24T01:53:27Z</dc:date>
    </item>
  </channel>
</rss>

