I have placed all the queries that I want to append as a new query in one group. I might add a few more in the future. So is there a way we can edit the code to include all the queries in the group
Asked
Active
Viewed 265 times
1 Answers
1
I'm not sure it's currently possible to do this exactly how you want, but there are some possible workarounds.
One possibility is to use the #shared
space and pick out the tables that you want. Try playing around with the query below where {"Column1", "Column2", ... }
is the list of column names in the group of queries that you want to append together.
let
Shared = Record.ToTable(#shared),
#"Added Custom" = Table.AddColumn(Shared, "Custom", each try Table.ColumnNames([Value]) = {"Column1", "Column2", ... }),
#"Expanded Custom" = Table.ExpandRecordColumn(#"Added Custom", "Custom", {"Value"}, {"HasCols"}),
#"Filtered Rows" = Table.SelectRows(#"Expanded Custom", each ([HasCols] = true)),
#"Expanded Value" = Table.ExpandTableColumn(#"Filtered Rows", "Value", {"Column1", "Column2", ... }, {"Column1", "Column2", ... })
in
#"Expanded Value"

Alexis Olson
- 38,724
- 7
- 42
- 64
-
Can you please elaborate on #shared space. I'm not familiar with that. – Gangula Aug 07 '18 at 19:13
-
It's a bit obscure and I don't know a ton about it, but I'd suggest reading this: http://radacad.com/power-query-library-of-functions-shared-keyword – Alexis Olson Aug 07 '18 at 20:43
-
thank you for the web link. That was a really great tip. – Gangula Aug 30 '18 at 12:37