Forum Discussion

Nathan0763's avatar
Nathan0763
Copper Contributor
May 20, 2019
Solved

vlook up Power query

Hello, I wish to create a personalized column in Power query for a data base. This column would be conditional: if the condition is true, you put a text, if it's not, you put the price related to the reference, which is in another worksheet of the file.

Is it possible to create this column with the advanced editor in Power Query?

 

Thank you, Nathan.

  • Nathan0763 

    Nathan, yes, that will be column with tables. Click on the icon with arrows on top right of that column header and extract Price and other fields which necessary. If you build relationship correctly it return Price or null if no related price. You may keep null as it is or replace it on zero.

5 Replies

  • SergeiBaklan's avatar
    SergeiBaklan
    Diamond Contributor

    Nathan0763 , perhaps first you need to merge you main table with another query with prices and extract prices. After that add custom column with

    if <condition> then [Text] else [Price]

    However, that's not a good idea to mix texts and numbers in one column.

    • Nathan0763's avatar
      Nathan0763
      Copper Contributor

      SergeiBaklan  Thanks for your reply. I tried to merge the two worksheets but the merger is just creating a column of "Tables".

      You were right about the format though, the condition returns either 0, or the price.

       

      Nathan.

      • SergeiBaklan's avatar
        SergeiBaklan
        Diamond Contributor

        Nathan0763 

        Nathan, yes, that will be column with tables. Click on the icon with arrows on top right of that column header and extract Price and other fields which necessary. If you build relationship correctly it return Price or null if no related price. You may keep null as it is or replace it on zero.

Resources