May 20 2019 05:17 AM
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.
May 20 2019 05:32 AM
@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.
May 20 2019 05:45 AM
@Sergei Baklan 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.
May 20 2019 06:09 AM
SolutionNathan, 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.
May 20 2019 07:02 AM
@Sergei Baklan Okay, that's working perfectly, thank you very much !
Nathan.
May 20 2019 06:09 AM
SolutionNathan, 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.