Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
admincaleb007
Frequent 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 populate the column.

 

Is there something I can do to populate this table data?  Everything that is sitting within the table is valid and will exist properly in the column.  Each table will have at least one entry, but may include more than one entry and I'll need all.

 

Theres a few items in the table that are having this similar problem, but in the screenshot you can see the issue in both 'cve' and 'xref'.

admincaleb007_2-1647032481334.png

 

admincaleb007_1-1647032465591.png

 

When I filter out all the "non-table" data in the column, we can see I am finally allowed to Expand the column, but then I am missing critical data.  I need the data in the tables to exist within the column.

admincaleb007_0-1647032446852.png

 

I read https://community.powerbi.com/t5/Desktop/Expand-Column-Containing-Some-Tables/m-p/412915#M189511 but I could not get it to work for me.  I am relatively new to power query so I may have been doing it wrong.

 

2 REPLIES 2
BartVW
Helper I
Helper I

@mahoneypat This is a neat solution that saved me today, thank you!

mahoneypat
Microsoft Employee
Microsoft 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





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.