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
This is my first post, please bare with me, and I am new in this forum, need help
I have a source data like as below
And the end goal will be like this,
Presently I am using the power query with this code
let
Source = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
#"Grouped Rows" = Table.Group(Source, {"Name"}, {{"All", each _, type table [Name=text, Address=text, City=text, State=text]}}),
#"Added Custom" = Table.AddColumn(#"Grouped Rows", "Custom", each Table.Column([All],"Address")),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "Custom.1", each Table.Column([All],"City")),
#"Added Custom2" = Table.AddColumn(#"Added Custom1", "Custom.2", each Table.Column([All],"State")),
#"Extracted Values" = Table.TransformColumns(#"Added Custom2", {"Custom", each Text.Combine(List.Transform(_, Text.From), "|"), type text}),
#"Extracted Values1" = Table.TransformColumns(#"Extracted Values", {"Custom.1", each Text.Combine(List.Transform(_, Text.From), "|"), type text}),
#"Extracted Values2" = Table.TransformColumns(#"Extracted Values1", {"Custom.2", each Text.Combine(List.Transform(_, Text.From), "|"), type text}),
#"Removed Columns" = Table.RemoveColumns(#"Extracted Values2",{"All"})
in
#"Removed Columns"
In real there are around 30 columns, how can avoid using Table.Column or if I am using Table.Column then how to combine all the columns dynamcially to achieve the above end goal.
Solved! Go to Solution.
let
Source = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
#"Grouped Rows" = Table.Group(Source, {"Name"}, List.Trandform(List.Skip(Table.ColumnNames(Source)),(x)=>{x,each Text.Combine(List.Transform(Table.Column(_,x),Text.From),"|")}))
in
#"Grouped Rows"
let
Source = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
#"Grouped Rows" = Table.Group(Source, {"Name"}, List.Trandform(List.Skip(Table.ColumnNames(Source)),(x)=>{x,each Text.Combine(List.Transform(Table.Column(_,x),Text.From),"|")}))
in
#"Grouped Rows"
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.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 5 | |
| 5 | |
| 4 |