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
Ashish_Mathur
Super User
Super User

Split entries in multiple columns to rows

Hi,

I have data in an MS Excel worksheet which has 13 columns and 2 rows.  Of the 13 columns, there is a single entry in the first 4 columns and in the balance 9 columns, each cell has multiple entries seperated by , and Alt+Enter.  I'd like to split data into rows so that each entry in the 9 columns appears in a rows of its own.

Please find my data and expected result in this workbook.

Thank you for your help.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @Ashish_Mathur 

 

Download Excel workbook example

 

Transpose the table, split the columns by delimiter (comma), transpose the table again, then fill down for the relevant columns.

let
    Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
    #"Transposed Table" = Table.Transpose(Source),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Transposed Table", "Column1", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), {"Column1.1", "Column1.2", "Column1.3", "Column1.4"}),
    #"Split Column by Delimiter1" = Table.SplitColumn(#"Split Column by Delimiter", "Column2", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), {"Column2.1", "Column2.2"}),
    #"Transposed Table1" = Table.Transpose(#"Split Column by Delimiter1"),
    #"Filled Down" = Table.FillDown(#"Transposed Table1",{"Column1", "Column2", "Column3", "Column4"})
in
    #"Filled Down"

ash1.png

regards

 

Phil

 



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Thank you @PhilipTreacy 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
PhilipTreacy
Super User
Super User

Hi @Ashish_Mathur 

 

Download Excel workbook example

 

Transpose the table, split the columns by delimiter (comma), transpose the table again, then fill down for the relevant columns.

let
    Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
    #"Transposed Table" = Table.Transpose(Source),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Transposed Table", "Column1", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), {"Column1.1", "Column1.2", "Column1.3", "Column1.4"}),
    #"Split Column by Delimiter1" = Table.SplitColumn(#"Split Column by Delimiter", "Column2", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), {"Column2.1", "Column2.2"}),
    #"Transposed Table1" = Table.Transpose(#"Split Column by Delimiter1"),
    #"Filled Down" = Table.FillDown(#"Transposed Table1",{"Column1", "Column2", "Column3", "Column4"})
in
    #"Filled Down"

ash1.png

regards

 

Phil

 



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


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.