<?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: Lookup max value in another column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-max-value-in-another-column/m-p/3535378#M135852</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="533538" data-lia-user-login="alagator28" class="lia-mention lia-mention-user"&gt;alagator28&lt;/a&gt;&amp;nbsp;Try this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Eligible Column in Table1 =
  VAR __Employee = 'Table1'[Employee]
  VAR __Date = 'Table1'[Date]
  VAR __Table = FILTER('Table2', [Employee] = __Employee &amp;amp;&amp;amp; [Date] &amp;gt;= __Date)
  VAR __Return = IF( __Table = BLANK(), "No", "Yes")
RETURN
  __Return&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 15 Nov 2023 15:23:28 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2023-11-15T15:23:28Z</dc:date>
    <item>
      <title>Lookup max value in another column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-max-value-in-another-column/m-p/3535353#M135850</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two tables shown below. I am looking to fill the "Eligible" column of Table1. There is a many to many relationship between the tables. I've been trying to accomplish this using the Lookupvalue function, but I have not been successful. Here are the requirements:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For each row in Table 1:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Check ALL rows in Table2 matching the Employee found in Table 1&lt;/LI&gt;&lt;LI&gt;If any rows in Table2 have a date which is equal to or greater than the row in Table1, return "Yes"&lt;/LI&gt;&lt;LI&gt;Otherwise, return "No"&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table1&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Employee&lt;/TD&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Eligible&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;John Smith&lt;/TD&gt;&lt;TD&gt;12/25/2023&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Yes&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;John Smith&lt;/TD&gt;&lt;TD&gt;12/28/2023&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;No&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table2&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Employee&lt;/TD&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;John Smith&lt;/TD&gt;&lt;TD&gt;12/21/2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;John Smith&lt;/TD&gt;&lt;TD&gt;12/24/2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;John Smith&lt;/TD&gt;&lt;TD&gt;12/25/2023&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2023 15:10:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-max-value-in-another-column/m-p/3535353#M135850</guid>
      <dc:creator>alagator28</dc:creator>
      <dc:date>2023-11-15T15:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup max value in another column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-max-value-in-another-column/m-p/3535378#M135852</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="533538" data-lia-user-login="alagator28" class="lia-mention lia-mention-user"&gt;alagator28&lt;/a&gt;&amp;nbsp;Try this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Eligible Column in Table1 =
  VAR __Employee = 'Table1'[Employee]
  VAR __Date = 'Table1'[Date]
  VAR __Table = FILTER('Table2', [Employee] = __Employee &amp;amp;&amp;amp; [Date] &amp;gt;= __Date)
  VAR __Return = IF( __Table = BLANK(), "No", "Yes")
RETURN
  __Return&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 15 Nov 2023 15:23:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-max-value-in-another-column/m-p/3535378#M135852</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2023-11-15T15:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup max value in another column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-max-value-in-another-column/m-p/3535415#M135854</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;. Unfortunately, I'm getting the following error:&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To troubleshoot this, I entered real values in the variables for __Employee and __Date and I still get the error. It seems to be coming from the __Table variable. I've made sure that the date format is exactly the same, as well as the matching Employee.&lt;BR /&gt;&lt;BR /&gt;Any clues on what I should check? Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2023 15:43:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-max-value-in-another-column/m-p/3535415#M135854</guid>
      <dc:creator>alagator28</dc:creator>
      <dc:date>2023-11-15T15:43:28Z</dc:date>
    </item>
  </channel>
</rss>

