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
joxe
Regular Visitor

How to divide a column keeping the delimiter?

Hello,

When I divide a column by delimiter in the result the delimiter is lost. How can I keep it?

Thanks.

1 ACCEPTED SOLUTION
watkinnc
Super User
Super User

You could use ReplaceValues and replace "<h3" with "<h3,", and then split using "," as the delimiter.
--Nate


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!

View solution in original post

5 REPLIES 5
watkinnc
Super User
Super User

You could use ReplaceValues and replace "<h3" with "<h3,", and then split using "," as the delimiter.
--Nate


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!

Very easy and very effective solution. Thank you very much!

joxe
Regular Visitor

Hi @Vera_33 again,

 

In my answer I did not show the formula, which maybe helps:

 

= Table.ExpandListColumn(Table.TransformColumns(#"Converted to Table", {{"Column1", Splitter.SplitTextByDelimiter("<h3", QuoteStyle.None), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Column1")

 

joxe_1-1622649512344.png

 

 

I compare it with the formula of your image, and I can't figure out how to adapt it.

 

Best regards,

 

Vera_33
Resident Rockstar
Resident Rockstar

Hi @joxe 

 

Can you provide some sample data and expected result? Not sure what exactly you want...split it by delimiter then add it back?

 

Vera_33_0-1622642833974.png

 

Hi Vera,

I am working with the code of a web page. I need to split a column into rows each time the <h3 text appears, which usually goes in a sequence: <h3 class = "article__title">. Therefore:

 

joxe_0-1622647290920.png

 

But after the step I lose the delimiter and, as you can see, each row starts with class = "article__title", and not wiht <h3 class = "article__title">, as I need:

 

joxe_1-1622647572021.png

 

Do you know how to keep the delimiter?

 

Thank you very much.

 

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
Top Kudoed Authors