cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mubar
Frequent Visitor

How to Split Multiple columns without repeating same steps?

I have 3 columns in my Power Query that contains some values of text & numbers. I wanted to split it by number of character to extract the text from numbers. I have done this one after the other, i want to know if there is an easy step I can apply to the column at once using M query.

Thanks

 

split column.png

 

2 REPLIES 2
jgordon11
Resolver I
Resolver I

Use List.Accumulate

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText(
        "NY/LDQQhDEN74Yws8iNQxFYwmv7b2AkJJ4uYPDvP0xbG/rXeNiTEwd/z7U8j6IoJQyl0QTydDa+
        /e4YODE5nQGNAZ9CbYOmFiWQKacJuDEM4ITqrR8EEttPxo5XuhdBa+FDzLuzT1OCW8ca38fIsRpTN
        44J07BSbsKJ60N4/", BinaryEncoding.Base64), Compression.Deflate)),
        type table [Value, Wage, #"Release Clause"]),
    tbl = List.Accumulate({"Value", "Wage","Release Clause"}, Source, (s,c)=> 
        Table.SplitColumn(s, c, Splitter.SplitTextByCharacterTransition({"0".."9","."}, (x) => 
            not List.Contains({"0".."9", "."}, x)), {c, c & ".1"}))
in   
    tbl

Here is my advanced editor, How can I use it?

Mubar_0-1679200441256.png

It's showing "Token Identifier Expected"

Helpful resources

Announcements
Exciting changes

Power BI Community Changes

Check out the changes to the Power BI Community announced at Build.

May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Kudo Data Story carousel

Data Stories Gallery

Visit our Data Stories Gallery and give kudos to your favorite Data Stories.

Top Solution Authors
Top Kudoed Authors