Forum Discussion
Expand column containing both text and table types
Hi,
I have an XML file where almost all columns contain mostly tables and can be expanded easily in the UI. However some columns contain both text and table types.
An example:
There isn't an "Expand" button in the column header. Is there anyway to expand these columns even though some cells contain text?
Thanks,
TR
Hi,
You can use below code in a step in the Query Editor.
Table.TransformColumns(Source, {{“Column1”, each if Value.Is(_, type table) then _ else #table({“Column1”}, {{_}} ) }} )Reference:
https://www.thebiccountant.com/2017/07/25/how-to-expand-a-column-that-cannot-be-expanded-in-power-bi-and-power-query-in-excel/
Written by ImkeFPrateek Raina
4 Replies
- prateekrainaMemorable Member
Hi,
You can use below code in a step in the Query Editor.
Table.TransformColumns(Source, {{“Column1”, each if Value.Is(_, type table) then _ else #table({“Column1”}, {{_}} ) }} )Reference:
https://www.thebiccountant.com/2017/07/25/how-to-expand-a-column-that-cannot-be-expanded-in-power-bi-and-power-query-in-excel/
Written by ImkeFPrateek Raina
- AnonymousNot applicable
Thanks - worked like a charm!
- ImkeFCommunity Champion
You have to transform the column before expanding: https://www.thebiccountant.com/2017/07/25/how-to-expand-a-column-that-cannot-be-expanded-in-power-bi-and-power-query-in-excel/
Table.TransformColumns(Source, {{“Scope Description”, each if Value.Is(_, type table) then _ else #table({"Column1"}, {{_}} ) }} ) - AnonymousNot applicable
Very Very Very HELPFUL !!! THX!!!