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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors