Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

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...
  • Vijay_A_Verma's avatar
    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"})