Forum Discussion

Nathan88's avatar
Nathan88
Copper Contributor
Jan 23, 2019

Power Query Vlookup Dynamic Column Reference

I have a query where Column "INDEX" values are the header names of other columns. I want to return the matching value. How can i do this in Power Query? Its basically a Vlookup with a dynamic col_index_num. I cannot seem to find a solution.. Thank you for the help!

 

 

2 Replies

  • SergeiBaklan's avatar
    SergeiBaklan
    Diamond Contributor

    In query on second table select KEY column, Unpivot other columns and add column with combined index. In query on first table create same combined index (KEY & "any text/symbol which is definitely not in your names" & INDEX), merge on it with second table and expand values only.

     

    Please check attached.

  • I'm moving your question to the Excel community for better visibility.

Resources