Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Not applicable

How to format string text by delimiter

Hi All,


I have the XML string column in my table and I want to structure it to look better, i.e. want to move text to a new row after this character '>'


To give you more context, below is what I have;  (it's hard to read the logic)



and this is how I want to format it (it doesn't need to have indentation)



Any other idea on how to make it more readable is welcome! 




Community Support
Community Support

Hi @Anonymous ,


This is my test table:



Enter ">" in "value to find" and enter ">#(lf)" in "replace with".



You will get a table like this and delete the character "(#)" selected by the mouse:



I think this is the result you want:



M code for your reference:

 #"Changed Type" = Table.TransformColumnTypes(Sheet51_Sheet,{{"Column1", type text}}),
    #"Promoted Headers" = Table.PromoteHeaders(#"Changed Type", [PromoteAllScalars=true]),
    #"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"XST schema", type text}}),
    #"Replaced Value" = Table.ReplaceValue(#"Changed Type1",">",">#(lf)",Replacer.ReplaceText,{"XST schema"})
    #"Replaced Value"


Best regards,

Yadong Fang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Solution Sage
Solution Sage

Hi @Anonymous , the result is only 1 column:


Do you have tranpose the table?.


Final result:



Not applicable

Sorry, meant that I need to keep the string in one cell as shown in my first screenshot. The reason is that I have 10 more columns with the 'XSLT Schema' column, so I can't transpose the table and have what I need. Thanks for the help!

Solution Sage
Solution Sage

Hi @Anonymous , try this:


1.- Split column by delimiter ">":



2.- Tranpose the table:


I hope it works for you, best regards


Not applicable

Thanks, but unfortunately this doesn't work for me as I need to keep the string in one column as shown in my first screenshot. I was hoping that there is a regular expression maybe that could help me.

Helpful resources

PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors