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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.