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

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

Reply
messengineer2
Frequent Visitor

Detecting position of Case Change within a String in Column of data

Hi All.
I have a series of thousands of User Names in a table column and the format is inconsistent and I am cleaning them up in M. 
So I am replacing things like "." with " " or "," with "" or changing all the strings which are entirely lowercase to Proper Case etc.
One of the remaining challenges is detecting where there is a change of Case and I want to add a space.
i.e. "SmithJ" I want to be changed to "Smith J" or "FredSmith" I want to be changed to "Fred Smith" to make the format consistent.
Since there are no wildcard options for case, and the position is completely random, struggling to think of a simple solution.
Any suggestions? Happy for a solution in either M or DAX.

Thanks in advance.

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

Text.Combine(Splitter.SplitTextByCharacterTransition({"a".."z"},{"A".."Z"})("SmithJ")," ")

View solution in original post

4 REPLIES 4
messengineer2
Frequent Visitor

Yes thanks. I already detected the Mc issue but hadnt thought of Mac.

messengineer2
Frequent Visitor

Thanks I didn't see that prebuilt option in the Menu Capture.PNG

Split Column > By Lowercase to Uppercase would be the analogous option.

 

Side note: Be careful with names like McCall or MacBride.

https://stackoverflow.com/questions/9551840/capitalize-last-names-including-exceptions-like-mccall-m...

wdx223_Daniel
Super User
Super User

Text.Combine(Splitter.SplitTextByCharacterTransition({"a".."z"},{"A".."Z"})("SmithJ")," ")

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Kudoed Authors