Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I need to extract some text from within a block of text into some new columns
Here is an exampe of the text. From it I need to create a column containing the leaver name (Daniel) and the date of leaving (11/09/2020). Would I do this using the Search function?
The Leaver Notification for Daniel has been confirmed by HR.
HR014 Details:
Leaver Name:Daniel
Date of Leaving: 11/09/2020
Emails to be forwarded: Yes
Email to forward to: steve
Is access to the user's files to be given? No
If yes, acess to be given to:
Remove person from the system from: 12/09/2020
Cancel phone account: No
If yes, mobile phone number:
For any questions, please email the 'UK HR' mailbox
Solved! Go to Solution.
Hi @Anonymous ,
Check the formula.
name =
var start1 = SEARCH("Leaver Name:",'Table'[Column1])+12
var end1 = SEARCH("Date of Leaving:",'Table'[Column1])-1
var start2 = SEARCH("Date of Leaving:",'Table'[Column1])+16
var end2 = SEARCH("Emails to be forwarded:",'Table'[Column1])-1
return
MID('Table'[Column1],start1,end1-start1)&MID('Table'[Column1],start2,end2-start2)
Best Regards,
Jay
Hi @Anonymous ,
Check the formula.
name =
var start1 = SEARCH("Leaver Name:",'Table'[Column1])+12
var end1 = SEARCH("Date of Leaving:",'Table'[Column1])-1
var start2 = SEARCH("Date of Leaving:",'Table'[Column1])+16
var end2 = SEARCH("Emails to be forwarded:",'Table'[Column1])-1
return
MID('Table'[Column1],start1,end1-start1)&MID('Table'[Column1],start2,end2-start2)
Best Regards,
Jay
Hi @Anonymous
Download this sample file with the following code
Try this in Power Query
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("TY/NTsMwEIRfZdQzUpMICeELBwJqBeohiAMqPTjtpI0Ue4PtBPL2OD9F3Nb+dmZn9vvVpkjSW+QMum68eqXu6bDThirXtmaDXAdCKoyotmeFNF0n9+ssyRI8mVGFICiJSty3dieeFD7oZzai5T+OCm+BPbH10Mcj/aQMF6LzdJ9dkmR3HlXd8Gp5rnvaB+wE2woD/U3ULbIrnWwLGom+LZ0Xi8qJmWz94APN9I6xs7/Yj9oeY7P2IpZjEulsUP+vGCljimXBdqakU3gWB20HfHX0oRYb99qG2hOcq8aLc4n3F2yKecSISvlZHQ6/", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Added Custom" = Table.AddColumn(Source, "Custom", each Text.BetweenDelimiters([Column1],"Leaver Name:","Emails to be forwarded")),
#"Split Column by Delimiter" = Table.SplitColumn(#"Added Custom", "Custom", Splitter.SplitTextByDelimiter("Date of Leaving:", QuoteStyle.None), {"Custom.1", "Custom.2"}),
#"Renamed Columns" = Table.RenameColumns(#"Split Column by Delimiter",{{"Custom.1", "Leaver Name"}, {"Custom.2", "Date of Leaving"}})
in
#"Renamed Columns"
Regards
Phil
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
144 | |
75 | |
63 | |
51 | |
48 |
User | Count |
---|---|
204 | |
86 | |
62 | |
59 | |
56 |