cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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:

 

Capture.PNG

 

 

 

 

 

 

 

 

 

 

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

1 ACCEPTED SOLUTION
prateekraina
Memorable Member
Memorable 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...
Written by @ImkeF

 

Prateek Raina

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Very Very Very HELPFUL !!! THX!!!

ImkeF
Super User
Super User

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...

 

Table.TransformColumns(Source, {{“Scope Description”, each if Value.Is(_, type table) then _ else #table({"Column1"}, {{_}} ) }} )

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

prateekraina
Memorable Member
Memorable 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...
Written by @ImkeF

 

Prateek Raina

Anonymous
Not applicable

Thanks - worked like a charm!

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

BizApps LATAM 2023

Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

Power Platform Bootcamp

Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.