Forum Discussion
admincaleb007
4 years agoFrequent Visitor
Cannot expand a column
I'm pulling in data via XML and experiencing an issue with columns containing Tables as well as valid data. I believe when a column contains both, I cannot expand the column to get the table data to...
mahoneypat
4 years agoMicrosoft Employee
Here's one way to do it in the query editor. To see how it works, just create a blank query, open the Advanced Editor and replace the text there with the M code below.
let
Source = #table({"TableColumn"}, {{1}, {null}, {#table({"Value"}, {{1}, {2}})}}),
Custom1 = Table.TransformColumns(Source, {"TableColumn", each if _ is table then _ else #table({"Value"}, {{_}})}),
#"Expanded TableColumn" = Table.ExpandTableColumn(Custom1, "TableColumn", {"Value"}, {"Value"})
in
#"Expanded TableColumn"
Pat