<?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: Date Range Lookup Across 2 Tables to Populate a Column with Associated Valuess in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Range-Lookup-Across-2-Tables-to-Populate-a-Column-with/m-p/2192218#M51272</link>
    <description>&lt;P&gt;Yes thank you! I can't pretend to know exactly what's going on, but it works!&lt;/P&gt;</description>
    <pubDate>Tue, 16 Nov 2021 10:37:40 GMT</pubDate>
    <dc:creator>MattSwan</dc:creator>
    <dc:date>2021-11-16T10:37:40Z</dc:date>
    <item>
      <title>Date Range Lookup Across 2 Tables to Populate a Column with Associated Valuess</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Range-Lookup-Across-2-Tables-to-Populate-a-Column-with/m-p/2185008#M50936</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to replicate similar functionality to a VLOOKUP in Excel with range lookup set to TRUE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Collections has a date column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Academic Years has a column called Academic Year and two date columns that specify a date range Start Date and End Date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 1: Collections&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Result Date
01/09/2020
05/05/2021
02/10/2021
02/02/2022&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 2: Academic Year&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Academic Year    Start Date     End Date   
2020/2021        01/09/2020     31/08/2021
2021/2022        01/09/2021     31/08/2020&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to creat a column in the Collection table that looks up the Result Date in the Academic Year table and if it falls between the Start Date and End Date Display the Academic Year. Like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ResultDate       Academic Year
01/09/2020       2020/2021
05/05/2021       2020/2021
02/10/2021       2021/2022
02/02/2022       2021/2022&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've done some searching to see if I could find a solution. The code I have so far is below. However, this results in a blank column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Academic Year = 
CALCULATE (
    SELECTEDVALUE ( 'Academic Years'[Academic Year] ),
    FILTER (
        'Academic Years',
        SELECTEDVALUE(Collections[Result Date]) &amp;gt;= 'Academic Years'[Start Date]
            &amp;amp;&amp;amp; SELECTEDVALUE(Collections[Result Date]) &amp;lt;= 'Academic Years'[End Date] 
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any assistance would be much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 10:14:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Range-Lookup-Across-2-Tables-to-Populate-a-Column-with/m-p/2185008#M50936</guid>
      <dc:creator>MattSwan</dc:creator>
      <dc:date>2021-11-11T10:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: Date Range Lookup Across 2 Tables to Populate a Column with Associated Valuess</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Range-Lookup-Across-2-Tables-to-Populate-a-Column-with/m-p/2185082#M50938</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="327239" data-lia-user-login="MattSwan" class="lia-mention lia-mention-user"&gt;MattSwan&lt;/a&gt;&amp;nbsp;See if LOOKUPVALUE Range helps:&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/LOOKUPVALUE-Range/m-p/974201#M430" target="_blank"&gt;(1) LOOKUPVALUE Range - Microsoft Power BI Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 11:01:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Range-Lookup-Across-2-Tables-to-Populate-a-Column-with/m-p/2185082#M50938</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-11-11T11:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: Date Range Lookup Across 2 Tables to Populate a Column with Associated Valuess</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Range-Lookup-Across-2-Tables-to-Populate-a-Column-with/m-p/2189785#M51161</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="327239" data-lia-user-login="MattSwan" class="lia-mention lia-mention-user"&gt;MattSwan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, I can roughly understand your requirement, I think you can try to create a calculated column in the table ‘Collections’ like this to achieve your requirement&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Academic Year =

CALCULATE(MAX('Academic Year'[Academic Year]),FILTER(ALL('Academic Year'),[Start Date]&amp;lt;=EARLIER(Collections[Result Date])&amp;amp;&amp;amp;[End Date]&amp;gt;EARLIER(Collections[Result Date])))&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>Mon, 15 Nov 2021 08:43:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Range-Lookup-Across-2-Tables-to-Populate-a-Column-with/m-p/2189785#M51161</guid>
      <dc:creator>v-robertq-msft</dc:creator>
      <dc:date>2021-11-15T08:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: Date Range Lookup Across 2 Tables to Populate a Column with Associated Valuess</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Range-Lookup-Across-2-Tables-to-Populate-a-Column-with/m-p/2192218#M51272</link>
      <description>&lt;P&gt;Yes thank you! I can't pretend to know exactly what's going on, but it works!&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 10:37:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-Range-Lookup-Across-2-Tables-to-Populate-a-Column-with/m-p/2192218#M51272</guid>
      <dc:creator>MattSwan</dc:creator>
      <dc:date>2021-11-16T10:37:40Z</dc:date>
    </item>
  </channel>
</rss>

