Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
My requirement should be fairly achievavble (to all the PQ Experts 🙂
I have data coming in horizontally and I want to stack certain columns below it. The below SS will tell you better. Please advise..
This is what I have
This is what I need
**Note: The table will continue to expand horizontally. So the stacking must happen dynamically**
Solved! Go to Solution.
Here's a full sample query you can paste into the Advanced Editor:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUUoEYhMgTgZicyBOU4rViVYyArKSgNgUiFOA2AKI08EyxlC1ZkCcCsSWQJyhFBsLAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t, Column4 = _t, Column5 = _t, Column6 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", Int64.Type}, {"Column2", type text}, {"Column3", Int64.Type}, {"Column4", type text}, {"Column5", Int64.Type}, {"Column6", type text}}),
ColPairs = List.Split(Table.ColumnNames(#"Changed Type"), 2),
NumberCol = List.Combine(List.Transform(List.Transform(ColPairs, each _{0}), each Table.Column(#"Changed Type", _))),
TextCol = List.Combine(List.Transform(List.Transform(ColPairs, each _{1}), each Table.Column(#"Changed Type", _))),
Combined = Table.FromColumns({NumberCol, TextCol}, {"Number", "Text"})
in
Combined
Here's a full sample query you can paste into the Advanced Editor:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUUoEYhMgTgZicyBOU4rViVYyArKSgNgUiFOA2AKI08EyxlC1ZkCcCsSWQJyhFBsLAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t, Column4 = _t, Column5 = _t, Column6 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", Int64.Type}, {"Column2", type text}, {"Column3", Int64.Type}, {"Column4", type text}, {"Column5", Int64.Type}, {"Column6", type text}}),
ColPairs = List.Split(Table.ColumnNames(#"Changed Type"), 2),
NumberCol = List.Combine(List.Transform(List.Transform(ColPairs, each _{0}), each Table.Column(#"Changed Type", _))),
TextCol = List.Combine(List.Transform(List.Transform(ColPairs, each _{1}), each Table.Column(#"Changed Type", _))),
Combined = Table.FromColumns({NumberCol, TextCol}, {"Number", "Text"})
in
Combined
Thanks a lot!
When you say "continue to expand horizontally", do you mean you'll be adding additional columns (and they'll always come in ordered pairs of number and text)?
Yes thats right. It will always be ordered and same data type.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |