Forum Discussion
dkay84_PowerBI
9 years agoMicrosoft Employee
Power Query Challenge for you M Ninjas
I would like a query or function that will append every column in a table into a single list with dups removed. The names and number of columns is random so the solution needs to be dynamic.
- 9 years ago
How about:
List.Distinct(List.Union(Table.ToColumns(Tabel1)))
(This is the entire query code)
Anonymous
9 years agoNot applicable
Will a single-column table result do? - e.g.:
let
Source = Table1,
#"Added Index" = Table.AddIndexColumn(Source, "Index", 1, 1),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Added Index", {"Index"}, "Attribute", "Value"),
#"Removed Other Columns" = Table.SelectColumns(#"Unpivoted Other Columns",{"Value"}),
#"Removed Duplicates" = Table.Distinct(#"Removed Other Columns")
in
#"Removed Duplicates"