Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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 II
Resolver II

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors