Forum Discussion
Anonymous
4 years agoNot applicable
Replacing values within column with if statement and text.startswith
Hi Newbie here so please be gentle! I'm using power query (M language). I am trying to modify a simple replace text command so that it is conditional using text.startswith. Ultimately I wa...
- 4 years ago
Use this (Replace Column1 and #"Added Custom" appropriately.
Table.ReplaceValue(#"Added Custom",each [Column1],each if Text.Start([Column1],1)="X" then Text.ReplaceRange([Column1],0,1,"") else [Column1], Replacer.ReplaceValue,{"Column1"})
Vijay_A_Verma
Most Valuable Professional
4 years agoUse this (Replace Column1 and #"Added Custom" appropriately.
Table.ReplaceValue(#"Added Custom",each [Column1],each if Text.Start([Column1],1)="X" then Text.ReplaceRange([Column1],0,1,"") else [Column1], Replacer.ReplaceValue,{"Column1"})
- PierreL691 year ago
Helper IV
Hi if I wanted to do the same thing but in multiple column is it possible to do it in one step or should I duplicate the code for each column ? (thanks)