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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
rpalardy
New Member

Split one column with multiple rows into multiple colunms and rows

I have one column of data with multiple rows, shown below.  What I need to do is create 6 columns and split the data out.  See second image.  

 

What I have today 

rpalardy_0-1712067634352.png

What I need

rpalardy_1-1712067689577.png

 

1 ACCEPTED SOLUTION
dufoq3
Super User
Super User

Hi @rpalardy,

 

Result:

dufoq3_0-1712068303093.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8g1RitUBUpk5+UU6CiEZmYl56WCRklyQEJjpWlEAZKZCODmJeiV5JXrJ+blgrpejn4KhsY6CkYERkDQ0tDI1U3D0BUuBCXdniBGZGSWl6ToKzkWVxSWZqWCx5FSwIKYVeVisMIJZYWxlYqoQgGRDsCuYckxJzM0sztBRcC3KTE6EGJoIEcO0IbEAwwZTuB+sTC3BXogFAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    FilteredRows = Table.SelectRows(Source, each ([Column1] <> "")),
    Transformed = Table.FromRows(List.Split(List.Transform(Table.ToList(FilteredRows), (x)=> Text.Remove(x, """")),6), {"Initials", "Name", "email", "user type", "appendix", "date"})
in
    Transformed

Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

View solution in original post

1 REPLY 1
dufoq3
Super User
Super User

Hi @rpalardy,

 

Result:

dufoq3_0-1712068303093.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8g1RitUBUpk5+UU6CiEZmYl56WCRklyQEJjpWlEAZKZCODmJeiV5JXrJ+blgrpejn4KhsY6CkYERkDQ0tDI1U3D0BUuBCXdniBGZGSWl6ToKzkWVxSWZqWCx5FSwIKYVeVisMIJZYWxlYqoQgGRDsCuYckxJzM0sztBRcC3KTE6EGJoIEcO0IbEAwwZTuB+sTC3BXogFAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    FilteredRows = Table.SelectRows(Source, each ([Column1] <> "")),
    Transformed = Table.FromRows(List.Split(List.Transform(Table.ToList(FilteredRows), (x)=> Text.Remove(x, """")),6), {"Initials", "Name", "email", "user type", "appendix", "date"})
in
    Transformed

Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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