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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Using Power Query (M) can I split a column value by uppercase characters?

Hi,

 

I have columns values such as the below:

 

JoeBloggs

TomJones

PeterKay

ChiAuYeung

 

I need to either add a <space> before each uppercase character (except the first character) or split the column on each uppercase character, is this possible using Power Query (M)?

 

Thanks.

1 REPLY 1
v-lili6-msft
Community Support
Community Support

hi, @Anonymous

    You can try to this code in Power Query

let
    Source = #table(type table[Enum = text],{{"TomJones"},{"ChiAuYeung"},{"JoeBloggs"},{"PeterKay"}            }),
    Splitted = Table.TransformColumns(Source, {{"Enum", each Splitter.SplitTextByPositions(Text.PositionOfAny(_,{"A".."Z"},Occurrence.All))(_)}}),
    Tabled = Table.TransformColumns(Splitted,{{"Enum", each Table.FromColumns(List.Zip({_}))}}),
    ColumnNames = Table.ColumnNames(Table.Combine(Tabled[Enum])),
    NewColumnNames = List.Transform(ColumnNames, each "Enum."&Text.Middle(_,6)),
    ExpandedEnum = Table.ExpandTableColumn(Tabled, "Enum", ColumnNames, NewColumnNames),
    TransformList = List.Transform(NewColumnNames, each {_,type text}),
    Typed = Table.TransformColumnTypes(ExpandedEnum, TransformList)
in
    Typed

Result:

4.PNG

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.