Forum Discussion

chmoon's avatar
chmoon
Frequent Visitor
9 years ago
Solved

Removing Numbers

I was wondering if anyone knew of a more elgant way to remove numbers from a string. I realized that Power BI does not support regular expressions. I know I could use R or another method to remove, b...
  • MarcelBeug's avatar
    9 years ago

    In the Query Editor you can either add a column with formula:

     

    = Text.Combine(List.RemoveItems(Text.ToList([TextWithDigits]),{"0".."9"}))

    Or transform the column: first choose Transform - Clean (or some other option) and then adjust the code in the formula bar to:

     

     

    = Table.TransformColumns(PreviousStep,{{"TextWithDigits", each Text.Combine(List.RemoveItems(Text.ToList(_),{"0".."9"}))}})

    the adjustment is the part starting with "each".