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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
DSR
Helper I
Helper I

In Power Query: Row has three rows in one cell – UPPER part. I want to separate each multiple box ro

Splitting one cell to separate muttiple line rows.png

4 ACCEPTED SOLUTIONS
Shravan133
Resolver I
Resolver I

 

  1. Select the column to split:

    • In the Power Query Editor, select the column that contains the multiple values you want to split into separate rows.
  2. Split column by delimiter:

    • Go to the "Transform" tab.
    • Click on "Split Column" and choose "By Delimiter".
    • Choose the delimiter that separates the values in your cell (e.g., comma, semicolon, space). In your case a Space? or new line?
    • In the Split Column by Delimiter dialog, select "Each occurrence of the delimiter" if your data is separated by the delimiter.
  3. Unpivot columns:

    • After splitting the column, the values will be in separate columns.
    • Select the original columns (excluding the newly created split columns).
    • Go to the "Transform" tab and click on "Unpivot Columns" and then "Unpivot Other Columns".
    • This will turn the split columns into rows.

View solution in original post

v-cgao-msft
Community Support
Community Support

Hi @DSR ,

Split to rows by #(lf) like this:

vcgaomsft_0-1716451052807.png

vcgaomsft_1-1716451086115.png

vcgaomsft_2-1716451199799.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcnRU0lHycAvy9wtR0FXwCPKJjCmKyfMPQRcJRxZQitWJVnJyIktnLAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}}),
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Changed Type", {{"Column2", Splitter.SplitTextByDelimiter("#(lf)", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Column2"),
    #"Trimmed Text" = Table.TransformColumns(#"Split Column by Delimiter",{{"Column2", Text.Trim, type text}})
in
    #"Trimmed Text"

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum -- China Power BI User Group

View solution in original post

Hello Shravan133,
Your method worked. Thank you. DSR

View solution in original post

@DSR Thats good. Can you please accept my response as a solution.

View solution in original post

4 REPLIES 4
v-cgao-msft
Community Support
Community Support

Hi @DSR ,

Split to rows by #(lf) like this:

vcgaomsft_0-1716451052807.png

vcgaomsft_1-1716451086115.png

vcgaomsft_2-1716451199799.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcnRU0lHycAvy9wtR0FXwCPKJjCmKyfMPQRcJRxZQitWJVnJyIktnLAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}}),
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Changed Type", {{"Column2", Splitter.SplitTextByDelimiter("#(lf)", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Column2"),
    #"Trimmed Text" = Table.TransformColumns(#"Split Column by Delimiter",{{"Column2", Text.Trim, type text}})
in
    #"Trimmed Text"

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum -- China Power BI User Group

Shravan133
Resolver I
Resolver I

 

  1. Select the column to split:

    • In the Power Query Editor, select the column that contains the multiple values you want to split into separate rows.
  2. Split column by delimiter:

    • Go to the "Transform" tab.
    • Click on "Split Column" and choose "By Delimiter".
    • Choose the delimiter that separates the values in your cell (e.g., comma, semicolon, space). In your case a Space? or new line?
    • In the Split Column by Delimiter dialog, select "Each occurrence of the delimiter" if your data is separated by the delimiter.
  3. Unpivot columns:

    • After splitting the column, the values will be in separate columns.
    • Select the original columns (excluding the newly created split columns).
    • Go to the "Transform" tab and click on "Unpivot Columns" and then "Unpivot Other Columns".
    • This will turn the split columns into rows.

Hello Shravan133,
Your method worked. Thank you. DSR

@DSR Thats good. Can you please accept my response as a solution.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Top Solution Authors
Top Kudoed Authors