<?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: VLookup in Power Query in Power Query</title>
    <link>https://community.fabric.microsoft.com/t5/Power-Query/VLookup-in-Power-Query/m-p/1288713#M41004</link>
    <description>&lt;P&gt;try to adapt this code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;img /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Aug 2020 21:43:49 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-08-11T21:43:49Z</dc:date>
    <item>
      <title>VLookup in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/VLookup-in-Power-Query/m-p/1288633#M41000</link>
      <description>&lt;P&gt;Good afternoon. I am working through modifying a vlookup for power query and am runninginto issues.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Goal: Fill in mgr grade_rank with the manager's grade rank.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Method: Match mgr_emplid and Employee ID columns and return the value in the grade_rank column.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the below example, I matched the mgr_emplid "1313" with the Employee ID "1313" and returned the value of "5" to mgr grade_rank.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know how to do it in excel, but am struggling to do it in powerquery as Lookup and Match functions. Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Current version:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Mgr Grade Rank = LOOKUPVALUE(Main[grade_rank],Main[mgr_emplid],Main[Employee ID],0)&amp;nbsp; &amp;nbsp;Then how do I add the match in and return the value?&amp;nbsp; Thank you.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 20:28:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/VLookup-in-Power-Query/m-p/1288633#M41000</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-11T20:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: VLookup in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/VLookup-in-Power-Query/m-p/1288702#M41003</link>
      <description>&lt;P&gt;THe easiest way to do this in Power Query is to merge the table with itself, but merge the Manager ID column with the Employee ID coluimn, then expand the grade.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then expand that field only.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I see your example is using LOOKUPVALUE() - that is a DAX function, and you&amp;nbsp;&lt;EM&gt;can&lt;/EM&gt; use this as a calculated column:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column = 
LOOKUPVALUE(
    [Grade],
    [EmployeeID],
    [mgrID]
)&lt;/LI-CODE&gt;
&lt;P&gt;It will return this:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;But I recommend against it.&amp;nbsp;In general, try to avoid calculated columns. There are times to use them, but it is rare. Getting data out of the source system, creating columns in Power Query, or DAX Measures are usually preferred to calculated columns. See these references:&lt;BR /&gt;&lt;A href="https://exceleratorbi.com.au/calculated-columns-vs-measures-dax/" rel="noopener" target="_blank"&gt;Calculated Columns vs Measures in DAX&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/" rel="noopener" target="_blank"&gt;Calculated Columns and Measures in DAX&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.sqlbi.com/articles/storage-differences-between-calculated-columns-and-calculated-tables//" rel="noopener" target="_blank"&gt;Storage differences between calculated columns and calculated tables&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Avoid the temptation to work in the Data view and create a bunch of calculated columns like you would think of when using Excel when you just add another column. Power BI is very different and that is not a good practice to get into. Try to use Power Query for transformations and bringing in new data, and Measures for data analysis. Avoid Calculated Columns where possible.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 21:42:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/VLookup-in-Power-Query/m-p/1288702#M41003</guid>
      <dc:creator>edhans</dc:creator>
      <dc:date>2020-08-11T21:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: VLookup in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/VLookup-in-Power-Query/m-p/1288713#M41004</link>
      <description>&lt;P&gt;try to adapt this code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 21:43:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/VLookup-in-Power-Query/m-p/1288713#M41004</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-11T21:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: VLookup in Power Query</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/VLookup-in-Power-Query/m-p/1289292#M41018</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , refer&lt;/P&gt;
&lt;P&gt;&lt;A href="https://eriksvensen.wordpress.com/2019/02/28/powerquery-replicate-doing-an-excel-vlookup-in-m/" target="_blank"&gt;https://eriksvensen.wordpress.com/2019/02/28/powerquery-replicate-doing-an-excel-vlookup-in-m/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.myonlinetraininghub.com/excel-power-query-vlookup" target="_blank"&gt;https://www.myonlinetraininghub.com/excel-power-query-vlookup&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2020 04:25:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/VLookup-in-Power-Query/m-p/1289292#M41018</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-08-12T04:25:12Z</dc:date>
    </item>
  </channel>
</rss>

