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 September 15. Request your voucher.

Reply
stephchnva
Frequent Visitor

How do I extract the 17-alphanumeric characters in a column, delimiter

Hello guys,

 

I need help. How do I extract the 17-alphanumeric characters in the "name" column.

I've tried different ways of extracting by delimiter but it's just not working.

 

Name
24/10/2024 / 1HGCM82633A123456 / Alex Johnson 
VF1XYZ9Z9L0456789 / 06/11/2024 / Jamie Smith 
20 Dec 2023 / David 

 

Thank you!

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

@stephchnva 

 

Download example PBIX file with the code below

 

 

= try List.Select(Text.Split([Name], " / "), each Text.Length(_) = 17){0} otherwise null 

 

 

PhilipTreacy_0-1731648647512.png

 

Regards

 

Phil

 



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

4 REPLIES 4
Omid_Motamedise
Super User
Super User

Hi @stephchnva 

 

Copy the below code and paste it into the advance editor

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjLRNzTQNzIwMlHQVzD0cHf2tTAyMzZ2NDQyNjE1A4o55qRWKHjlZ+QV5+cpKMXqRCuFuRlGREZZRln6GACVmFtYAlUZmOkbGsKM8UrMzUxVCM7NLMmA6DAyUHBJTVYAShsDpV0SyzJTgBKxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t]),
    #"Added Custom" = Table.AddColumn(Source, "Custom", each List.Select(Text.Split([Name]," / "),(x)=>Text.Length(x)=17){0})
in
    #"Added Custom"
If my answer helped solve your issue, please consider marking it as the accepted solution. It helps others in the community find answers faster—and keeps the community growing stronger!
You can also check out my YouTube channel for tutorials, tips, and real-world solutions in Power Query with the following link
https://youtube.com/@omidbi?si=96Bo-ZsSwOx0Z36h
ThxAlot
Super User
Super User

For simplicity and accuracy, incorporate regular express by python script,

ThxAlot_2-1731660262298.png

 

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("NYzLCsIwEEV/ZchaSGYS02ZZLCpFV4JoQxehBhJoUvGFn2+guL3nnGstI8VRcBKkgAPud5tjTVrKBkmqtS5bM/kvdHPIzzkDG1aWnbd4ufamNwdRlKo2xRKaI/5vOpeih1OKr7AUJKD1IxQsC27dJ94WgJWb7sHld/KPOEJObBh+", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t]),
    #"Added pq" = Table.AddColumn(Source, "pq", each List.Select(Text.Split([Name], " / "), each Text.Length(_) = 17 and not Text.Contains(_, " ")){0}?),
    #"Run Python script" = Python.Execute("df['py re'] = df['Name'].str.findall(r'\w{17}').apply(lambda match: match[0] if len(match)>0 else '')",[df=#"Added pq"]),
    Result = #"Run Python script"{[Name="df"]}[Value]
in
    Result

 

 

ThxAlot_3-1731660298318.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



PhilipTreacy
Super User
Super User

@stephchnva 

 

Download example PBIX file with the code below

 

 

= try List.Select(Text.Split([Name], " / "), each Text.Length(_) = 17){0} otherwise null 

 

 

PhilipTreacy_0-1731648647512.png

 

Regards

 

Phil

 



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


= Table.AddColumn(dataset, "pq", each List.Select(Text.Split([Name], " / "), each Text.Length(_) = 17 and not Text.Contains(_, " ")){0}?)

ThxAlot_0-1731659972458.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors