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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
messengineer2
Regular 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
Regular Visitor

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

messengineer2
Regular 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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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