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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
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)

xmlPowerBI.PNG

 

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

xmlOriginal.PNG

 

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

 

Thanks,

 

5 REPLIES 5
v-yadongf-msft
Community Support
Community Support

Hi @Anonymous ,

 

This is my test table:

vyadongfmsft_0-1668412235425.png

 

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

vyadongfmsft_1-1668412271851.png

 

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

vyadongfmsft_3-1668412412159.png

 

I think this is the result you want:

vyadongfmsft_4-1668412531811.png

 

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"})
in
    #"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.

Bifinity_75
Solution Sage
Solution Sage

Hi @Anonymous , the result is only 1 column:

 

Do you have tranpose the table?.

 

Final result:

Bifinity_75_0-1668082935939.png

 

Anonymous
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!

Bifinity_75
Solution Sage
Solution Sage

Hi @Anonymous , try this:

 

1.- Split column by delimiter ">":

Bifinity_75_0-1668081369783.png

 

2.- Tranpose the table:

Bifinity_75_1-1668081410798.png

I hope it works for you, best regards

 

Anonymous
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

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.