<?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 DAX for advanced look up in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-advanced-look-up/m-p/2663039#M79033</link>
    <description>&lt;P&gt;(Simplified) I have 2 tables and want to look-up the charge out rate applicable for each member of staff, based on the invoice date:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 1:&lt;/P&gt;&lt;P&gt;Col A: invoice date&lt;/P&gt;&lt;P&gt;Col B: employee&lt;/P&gt;&lt;P&gt;Col C: I want to look up their charge out rate applicable for when the job was done&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 2:&lt;/P&gt;&lt;P&gt;Column A: employee&lt;/P&gt;&lt;P&gt;Column B:&amp;nbsp; date&lt;/P&gt;&lt;P&gt;Column C: rate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 2 Example:&lt;/P&gt;&lt;P&gt;Col A.....Col B.....Col C&lt;/P&gt;&lt;P&gt;John&amp;nbsp; &amp;nbsp; &amp;nbsp;15/01/2022.&amp;nbsp; &amp;nbsp; 100&lt;/P&gt;&lt;P&gt;John&amp;nbsp; &amp;nbsp; &amp;nbsp; 03/07/2022.&amp;nbsp; &amp;nbsp; 120&lt;/P&gt;&lt;P&gt;Here you see that John's charge out rate is £100 from 15/01/2022 to 02/07/2022 where it then changes to £120&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way of working this out the rate or does Table 2 need to include all dates in order to find a match ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 26 Jul 2022 19:10:35 GMT</pubDate>
    <dc:creator>AndyDD_UK</dc:creator>
    <dc:date>2022-07-26T19:10:35Z</dc:date>
    <item>
      <title>DAX for advanced look up</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-advanced-look-up/m-p/2663039#M79033</link>
      <description>&lt;P&gt;(Simplified) I have 2 tables and want to look-up the charge out rate applicable for each member of staff, based on the invoice date:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 1:&lt;/P&gt;&lt;P&gt;Col A: invoice date&lt;/P&gt;&lt;P&gt;Col B: employee&lt;/P&gt;&lt;P&gt;Col C: I want to look up their charge out rate applicable for when the job was done&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 2:&lt;/P&gt;&lt;P&gt;Column A: employee&lt;/P&gt;&lt;P&gt;Column B:&amp;nbsp; date&lt;/P&gt;&lt;P&gt;Column C: rate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 2 Example:&lt;/P&gt;&lt;P&gt;Col A.....Col B.....Col C&lt;/P&gt;&lt;P&gt;John&amp;nbsp; &amp;nbsp; &amp;nbsp;15/01/2022.&amp;nbsp; &amp;nbsp; 100&lt;/P&gt;&lt;P&gt;John&amp;nbsp; &amp;nbsp; &amp;nbsp; 03/07/2022.&amp;nbsp; &amp;nbsp; 120&lt;/P&gt;&lt;P&gt;Here you see that John's charge out rate is £100 from 15/01/2022 to 02/07/2022 where it then changes to £120&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way of working this out the rate or does Table 2 need to include all dates in order to find a match ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2022 19:10:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-advanced-look-up/m-p/2663039#M79033</guid>
      <dc:creator>AndyDD_UK</dc:creator>
      <dc:date>2022-07-26T19:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for advanced look up</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-advanced-look-up/m-p/2663682#M79069</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="417561" data-lia-user-login="AndyDD_UK" class="lia-mention lia-mention-user"&gt;AndyDD_UK&lt;/a&gt; , Based on what I got. &lt;/P&gt;
&lt;P&gt;You need a new column first&lt;/P&gt;
&lt;P&gt;end Date = minx(filter(Table, [Name] = earlier([Name]) &amp;amp;&amp;amp; [Date] &amp;gt; earlier([date])), [Date]) -1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then use the logic in blog or file to expand&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-divide-distribute-values-between-start-date-or-end-date/ba-p/1503785" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-divide-distribute-values-between-start-date-or-end-date/ba-p/1503785&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2022 03:50:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-advanced-look-up/m-p/2663682#M79069</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-07-27T03:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for advanced look up</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-advanced-look-up/m-p/2672412#M79738</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="417561" data-lia-user-login="AndyDD_UK" class="lia-mention lia-mention-user"&gt;AndyDD_UK&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try formula like below:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Look_up_date =
CALCULATE (
    MAX ( Table2[invoice date] ),
    FILTER (
        ALL ( Table2 ),
        Table2[invoice date] &amp;lt;= MAX ( Table1[invoice date] )
            &amp;amp;&amp;amp; Table2[employee] = MAX ( Table1[employee] )
    )
)
&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Look_up_rate =
CALCULATE (
    MAX ( Table2[Rate] ),
    FILTER (
        Table2,
        Table2[employee] = MAX ( Table1[employee] )
            &amp;amp;&amp;amp; Table2[invoice date] = [Look_up_date]
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Eason&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 09:25:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-advanced-look-up/m-p/2672412#M79738</guid>
      <dc:creator>v-easonf-msft</dc:creator>
      <dc:date>2022-08-01T09:25:28Z</dc:date>
    </item>
  </channel>
</rss>

