Forum Discussion
Extract Text Before Delimiter for multiple columns in a single query step
- 4 years ago
Select all of the columns you want to transform before applying Transform > Extract > Text.BeforeDelimiter and it should apply the step to all of the selected columns in a single step with M code that looks like this:
= Table.TransformColumns(Source, { {"Column1", each Text.BeforeDelimiter(_, "|"), type text}, {"Column2", each Text.BeforeDelimiter(_, "|"), type text}, {"Column3", each Text.BeforeDelimiter(_, "|"), type text} })If you need to, you can edit each of these transformations separately (like if different columns use different delimiters or need an entirely different transformation).
Select all of the columns you want to transform before applying Transform > Extract > Text.BeforeDelimiter and it should apply the step to all of the selected columns in a single step with M code that looks like this:
= Table.TransformColumns(Source,
{
{"Column1", each Text.BeforeDelimiter(_, "|"), type text},
{"Column2", each Text.BeforeDelimiter(_, "|"), type text},
{"Column3", each Text.BeforeDelimiter(_, "|"), type text}
})
If you need to, you can edit each of these transformations separately (like if different columns use different delimiters or need an entirely different transformation).
This worked great, thanks for the help. 🙂