Forum Discussion
Split rows into multiple rows by line breaks
- 6 years ago
Hi Anonymous ,
Here is the pbix Split rows PBIX
So I split the 2nd col by delimiter. Which might be the only tricky part for you. When I built a table to match yours I had to do a "Shift Enter" to get data on subsequent rows visually. You may have to play around with how to split the column, but from there it is easy, select first column and unpivot other rows, then delete attribute column.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel
Hi Anonymous ,
What do you mean by Line Broken Data? And are these two columns with the same name?
Nathaniel
Hi NathP ,
I mean data where in one cell there's multiple lines of data, like in the tables above. And sorry, no, they were not meant to have the same name, I've now fixed that.
- Nathaniel_C6 years ago
Community Champion
Hello Anonymous ,
Will send the pbix in a minute.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel
From the Advanced Editorlet Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcslMzM3PS1HSUXKMyXOKyXNWitWJVgosTSwqqQIKusTkucbkuYEFA1ITi3KAYu4xeR5KsbEA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column1.1 = _t]), #"Split Column by Delimiter" = Table.SplitColumn(Source, "Column1.1", Splitter.SplitTextByDelimiter("#(lf)", QuoteStyle.Csv), {"Column1.1.1", "Column1.1.2", "Column1.1.3"}), #"Changed Type" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Column1", type text}, {"Column1.1.1", type text}, {"Column1.1.2", type text}, {"Column1.1.3", type text}}), #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Column1"}, "Attribute", "Value"), #"Removed Columns" = Table.RemoveColumns(#"Unpivoted Other Columns",{"Attribute"}) in #"Removed Columns"- Nathaniel_C6 years ago
Community Champion
Hi Anonymous ,
Here is the pbix Split rows PBIX
So I split the 2nd col by delimiter. Which might be the only tricky part for you. When I built a table to match yours I had to do a "Shift Enter" to get data on subsequent rows visually. You may have to play around with how to split the column, but from there it is easy, select first column and unpivot other rows, then delete attribute column.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel- Anonymous6 years agoNot applicable