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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
RhysWhite
Frequent Visitor

Splitting by Delimiter - If Delimiter isn't present then skip to next one

I hope somebody can help me quickly,

 

I have eMail data coming into Excel via Power Automate and I need to extract a reference number from either the Subject Or Body of the eMail.

Most of the references are preceded by certain words such as Reference or Number.

The solution I have come up with is to use Split Column By Delimiter - how do I search for multiple delimiters if the last one wasn't present?

Is this correct?  This is the base 
= Table.SplitColumn(Table.TransformColumnTypes(#"Changed Type", {{"Subject", type text}}, "en-GB"), "Subject", Splitter.SplitTextByAnyDelimiter({"Number"}, QuoteStyle.Csv, true), {"Subject.1", "Subject.2"})

If I modify it like this with multiple conditions it still seems to miss some.
= Table.SplitColumn(Table.TransformColumnTypes(#"Changed Type", {{"Subject", type text}}, "en-GB"), "Subject", Splitter.SplitTextByAnyDelimiter({"Number", "Reference", "no."}, QuoteStyle.Csv, true), {"Subject.1", "Subject.2"})


1 ACCEPTED SOLUTION
RhysWhite
Frequent Visitor

I've noticed I've put this in the wrong area, it should be in Power Queries.

Moving & Reposting now.

View solution in original post

3 REPLIES 3
RhysWhite
Frequent Visitor

I've noticed I've put this in the wrong area, it should be in Power Queries.

Moving & Reposting now.

amitchandak
Super User
Super User

@RhysWhite ,
Can you please share sample data and sample output in table format?

 

I think you need to do two or more splits OR use Text.Contains and then do it

@amitchandak Thanks - I can't share data - our policies make it very difficult to share anything externally.

Thanks Anyway

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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