Forum Discussion
AmberJane
4 years agoHelper III
Override/Edit a Single Cell
I have a data set that pulls in a long text ID that translates to a project name. I normally would replace values on the ID to the Project name and that worked in most cases. However I have some one ...
- 4 years ago
I struggled through this and couldn't get it to work. I however was able to fix it using a conditional column. The value I needed was in another column so using the custom conditional column I was able to say if it matches this unique ID then grab from that other column.
AlexisOlson
4 years agoSuper User
You can modify Table.ReplaceValue to edit rows only under certain conditions.
For example, if you replace "A" with "aaa", in [Column1] the code looks something like this:
= Table.ReplaceValue(#"Changed Type", "A", "aaa", Replacer.ReplaceText, {"Column1"})
Suppose you have an index column and you only want this replacement to be valid for the row where index = 6. Then you could write
= Table.ReplaceValue(#"Changed Type", "A", each if [Index] = 6 then "aaa" else "A", Replacer.ReplaceText, {"Column1"})