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.
Hey! I want to know how can I split my column in the following way
I have data like: s1 1 2 3
s2 1 2 3
s3 1 2 3
and what I want is s1 s2 s3 1 2 3, all in one row. Is it possible to do this in power query ?
Thank You!
Solved! Go to Solution.
You may refer to the following code snippet.
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WKjZUMFQwUjBWitUBcoyQOcYwTiwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}), #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Changed Type", {{"Column1", Splitter.SplitTextByDelimiter(" ", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Column1"), #"Removed Duplicates" = Table.Distinct(#"Split Column by Delimiter"), #"Sorted Rows" = Table.Sort(#"Removed Duplicates",{{"Column1", Order.Ascending}}), #"Transposed Table" = Table.Transpose(#"Sorted Rows") in #"Transposed Table"
You may refer to the following code snippet.
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WKjZUMFQwUjBWitUBcoyQOcYwTiwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}), #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Changed Type", {{"Column1", Splitter.SplitTextByDelimiter(" ", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Column1"), #"Removed Duplicates" = Table.Distinct(#"Split Column by Delimiter"), #"Sorted Rows" = Table.Sort(#"Removed Duplicates",{{"Column1", Order.Ascending}}), #"Transposed Table" = Table.Transpose(#"Sorted Rows") in #"Transposed Table"
@ishana time for you to provide feedback!
Either mark the appropriate solution as the solution, or provide more information if none of the solutions happens to be what you are looking for.
Hey,
it is ...
I started with this table
Than i selected the columns c1, c2, c3 and created a new column: Add column --> From Text --> Merge Columns
Than I selected the column "pivot" and pivoted the Transform --> Any Column --> Pivot Column
The result
Due to the fact that "Pivot column" need a Value column I'm not sure if this will work for you, but maybe you will give it a try
Regards
@ishana wrote:Hey! I want to know how can I split my column in the following way
I have data like: s1 1 2 3
s2 1 2 3
s3 1 2 3
and what I want is s1 s2 s3 1 2 3, all in one row. Is it possible to do this in power query ?
Thank You!
Hey! I want to know how can I split my column in the following way
I have data like: s1 1 2 3
s2 1 2 3
s3 1 2 3
and what I want is s1 s2 s3 1 2 3, all in one row. Is it possible to do this in power query ?
Thank You!
The following code gives you the values from column1 plus the other values from row 1 all in 1 row:
= Table.FromRows({Table1[Column1]&List.Skip(Record.FieldValues(Table1{0}))})
If this is not what you are looking for, please provide a better explanation.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |