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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Sorting header and data columns separated by commas

This might be quite easy to solve but I'm stuck with this for a while now.

I've got this "simple" estructure coming from a XML file:

 

headersdata
name,surname,address,city,phoneJohn,Smith,Baker st. 21B,London,3758
name,surname,address,city,phoneCarol,Newman,Picadilly 23,London,5663
name,surname,address,city,phoneBernard,Collins,7th Avenue 432,NYC,3456

 

and obviously what I would like would be something like:

 

namesurnameaddresscityphone
JohnSmithBaker st. 21BLondon3758
CarolNewmanPicadilly 23London5663
BernardCollins7th Avenue 432NYC3456

 

Now take in consideration that we're talking about millions of rows and there are more headers than in the example, so performance matters here. Please, could anybody provide any tips? Thanks!

1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

in Query editor you can add custom column like this

Record.FromList(Text.Split([data], ","), Text.Split([headers], ","))

and then expand the new column



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

2 REPLIES 2
Stachu
Community Champion
Community Champion

in Query editor you can add custom column like this

Record.FromList(Text.Split([data], ","), Text.Split([headers], ","))

and then expand the new column



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Anonymous
Not applicable

Perfect! Thanks!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors