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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
DebbieE
Community Champion
Community Champion

Messy Column. in Query editor can I pull out data thats two Capital letters and then a Word?

I have some data that contains a column with lots of information. I think it needs splitting up into more columns but its not simple to deal with.

 

All the detail is split with -

 

In some cases I know that I am looking for region. This can be added to a region column. 

Region is for example - AU Central.

 

Id be able to do this in SQL but how can I 

 

Create a new column using data that starts with - CAPITAL LETER CAPITAL LETTER  then anything until we get to -

 

Annoyingly the column can have none to 4 - so there is no way of knowing where this info is. Just that it starts with two capital letters for the code

 

Any Help would be very much appreciated

 

Debbie

1 ACCEPTED SOLUTION
DebbieE
Community Champion
Community Champion

Unfortunately not. The only thing I have is that the code is two capital letters.

 

I think what I would have to do then in this situation is actually import into SQL and do some cleaning with a bit of SQL Scripting first before moving into power BI

View solution in original post

3 REPLIES 3
jstorm
Resolver III
Resolver III

Transformation -> Split...by Delimiter -> Split at...each occurrence of delimiter

kentyler
Solution Sage
Solution Sage

There are no regular expression functions in M, so you have to work around it.

Do you know in advance what the "region" abbreviations are ?

You could split the columns on the "-" and then compare the first 2 letters with your list of regions.

 





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


DebbieE
Community Champion
Community Champion

Unfortunately not. The only thing I have is that the code is two capital letters.

 

I think what I would have to do then in this situation is actually import into SQL and do some cleaning with a bit of SQL Scripting first before moving into power BI

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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