Forum Discussion
JonPT
1 year agoRegular Visitor
Extract Alphanumeric Value from String
Hi Power BI Desktop Forum I'm trying to extract an 8-character alphanumeric value from a column in Power BI desktop. The pattern to extract is: first 2 characters are lower case a-z, followed by an...
- 1 year ago
Hi,
Create a custom column as below
= let
Source = [String],
Pattern = List.First(List.Select(List.Transform({0..Text.Length(Source)-8}, each Text.Middle(Source, _, 8)), each Text.Length(_) = 8 and Text.Middle(_, 0, 2) = Text.Select(Text.Middle(_, 0, 2), {"a".."z"}) and Text.Middle(_, 2, 6) = Text.Select(Text.Middle(_, 2, 6), {"0".."9"})))
in
if Pattern = null then null else Pattern
Greg_Deckler
Community Champion
1 year agoJonPT See if this similar solution helps: Solved: Remove first characters that are numbers - Microsoft Fabric Community