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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
DebbieE
Community Champion
Community Champion

XML Source. Column contains Table but cant expand this column

Hi,

 

Im importing XML Files. Ive expanded all the hierarchies and named pair values and Im left with this columnTableIssue.GIF

But you cant expand down. I cant Close and Apply because I get errors due to this column and Im unsure what to do. I dont want to delete this column. I want to use it?

 

Any help would be really appreciated 

 

 

5 REPLIES 5
Stachu
Community Champion
Community Champion

are all the tables in that column in the same format? it could be PowerbI struggles with expanding if they have different scope
can you the error messages that you get when you keep this column?



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

DebbieE
Community Champion
Community Champion

I did try deleting it but this annoyingly didnt resolve the issue

 

We cannot convert the value “System Host Name: MI ….“ to type Table

 

So thats something else to try and figure out

 

In regards to this. Some of them are Text and some of them are null. 

 

Im really now sure what the best way forward is with this one

This blogpost describes how you can solve it: https://www.thebiccountant.com/2017/07/25/how-to-expand-a-column-that-cannot-be-expanded-in-power-bi...

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

DebbieE
Community Champion
Community Champion

Im sorry, Ive read the article and I still dont know how to resolve my issue Man Sad

 

I have lots of XML files being imported into one table

 

I have one field called helpdesk-ticket", type and some XML files deal with it differently to others causing the issue

 

For example for some files I can Expand type and see the data

 

For the other set of files I Expand Type and see [Table]. I then have to click on this again, choose element text and then I can see the data.

 

Is there any way I can stop the error so I can bring all the files in together. Ive taken two files as an example

 

let
Source = Folder.Files("C:\............\Exampleticketissue"),
#"Filtered Hidden Files1" = Table.SelectRows(Source, each [Attributes]?[Hidden]? <> true),
#"Invoke Custom Function1" = Table.AddColumn(#"Filtered Hidden Files1", "Transform File from Exampleticketissue", each #"Transform File from Exampleticketissue"([Content])),
#"Renamed Columns1" = Table.RenameColumns(#"Invoke Custom Function1", {"Name", "Source.Name"}),
#"Removed Other Columns1" = Table.SelectColumns(#"Renamed Columns1", {"Source.Name", "Transform File from Exampleticketissue"}),
#"Expanded Table Column1" = Table.ExpandTableColumn(#"Removed Other Columns1", "Transform File from Exampleticketissue", Table.ColumnNames(#"Transform File from Exampleticketissue"(#"Sample File (10)"))),
#"Changed Type" = Table.TransformColumnTypes(#"Expanded Table Column1",{{"Source.Name", type text}, {"helpdesk-ticket", type any}, {"Attribute:type", type text}}),
#"Expanded helpdesk-ticket" = Table.ExpandTableColumn(#"Changed Type", "helpdesk-ticket", {"ticket-type"}, {"helpdesk-ticket.ticket-type"}),
#"Expanded helpdesk-ticket.ticket-type" = Table.ExpandTableColumn(#"Expanded helpdesk-ticket", "helpdesk-ticket.ticket-type", {"Element:Text"}, {"helpdesk-ticket.ticket-type.Element:Text"}),
#"Filtered Rows" = Table.SelectRows(#"Expanded helpdesk-ticket.ticket-type", each true)
in
#"Filtered Rows"

Error2.GIF

 

 

 

If there are different structures in your tables, you either use different queries/function to open them, or you include statements like:

 

if Value.Is(..., ,type table) then ..do the table thing.. else .. do the text-thing..

 

so you basically check which type and the do the appropriate action.

 

It's laborious, but I cannot think of a different way.

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.