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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
rvnaresh
Microsoft Employee
Microsoft Employee

extract text using Multiple delimiters

Hi,

 

I have the data imported from a source in a table in the below format. The column "Location" contains the data and I want to extract the data into a new column (Text Retrieval) as below. There are 2 delimiters (AZ and F0) that I can use and extract the text, If there is no data in the column, the new column must say NA.

 

LocationText retrieval
SIN01F02C03SIN01
GR04F01C01GER04
INDI03F03C03IND03
PAREU02AZBC02PAR02
nullNA
CAL20AZAC01CAL20
nullNA
CAN01F01C01CAN01

 

I added a new colum in the table using Add Column > Extract > Text before delimiter. Using the length of text isnt feasible as the length isn't fixed. Text before delimiter worked but only those rows that have F0 in the Location column yielded the results. Data from the other 2 paramteres weren't considered.

 

#"Inserted Text Before Delimiter" = Table.AddColumn(#"Filtered Rows2", "Text Before Delimiter", each Text.BeforeDelimiter([Assembly], "F0"), type text)
in
#"Inserted Text Before Delimiter"

 

I tried using the below but it didnot work:

Table.TransformColumns(Source, {{"Column1", each Text.Start(_, Text.PositionOfAny(_,{"F0","AZ"})), type text}})

 

Please help,

 

Thnks,

RVN

1 ACCEPTED SOLUTION
Vijay_A_Verma
Most Valuable Professional
Most Valuable Professional

You can use this formula in a custom column

= if [Location]=null then "NA" else  Splitter.SplitTextByAnyDelimiter({"AZ", "F0"})([Location]){0}

View solution in original post

2 REPLIES 2
Vijay_A_Verma
Most Valuable Professional
Most Valuable Professional

You can use this formula in a custom column

= if [Location]=null then "NA" else  Splitter.SplitTextByAnyDelimiter({"AZ", "F0"})([Location]){0}

Awesome! Thanks much, @Vijay_A_Verma 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.