I keep thinking this should be easy, but the answer is shying away from me. In Excel Power Query, I would like to convert the value in each row of a column based on a different column value. For example, suppose I have table 1 as follows:
Column A | Column B ------------------- X | 1 Y | 2
I would like to convert the values ββin column A based on the values ββin column B without adding a new column or replacing the original column A. I tried using TransformColumns, but the input can only be the value of the target column - I cannot access other field values ββin row / records from the TransformColumns function. I would like to be able to do something like this:
=Table.TransformColumns(Table1, {"Column A", each if [Column B]=1 then "Z" else _ })
which will result in:
Column A | Column B ------------------- Z | 1 Y | 2
I know there are ways to do this, but I'm trying to find it with the least number of steps / transforms. For example, I know that I could use Table.AddColumn to add a new column A based on a function that looks at column B, but then I need to remove the original column A and replace it with a new column A, which requires a few additional steps.
source share