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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Thejeswar
Super User
Super User

Convert Sharepoint list sublists to tables in Power BI Desktop

Hi Guys,

The Below is my scenario

 

I have a Sharepoint list which is having multiple other lists associated with it. This I can see if I import the list into Power BI using the Sharepoint List Data Connector.

 

Suppose A is my list and it has B and C as the associated list.

When I import data from List A, the import takes a couple of minutes.

Now if I expand any of my sublists B or C, the data import is becoming very slow. I takes more than 7 hours in my case.

 

So to avaid this I thought of using the associated lists as separate tables in power bi. Now the limitation that I am facing is,

How do I convert the Sublist as a separate table.?

 

P.S. For the information, if I expand the needed list to a new query from the sublists for list A, the new query gets created. But this also happens on top of the existing List A

 

can someone let me know how to handle this?

1 ACCEPTED SOLUTION

Hi @Thejeswar

I can reproduce your problem.

Please pay attention to the characters colored.

let

    Source = Table1,

    #"Added Custom" = Table.AddColumn(Source, "Custom", each Table.FromList([Custom1],Record.FieldValues)),

    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"somethng", "DateStart", "DateEnd", "Custom1", "Custom2"}),

    #"Expanded Custom" = Table.ExpandTableColumn(#"Removed Columns", "Custom", {"Column1", "Column2"}, {"Custom.Column1", "Custom.Column2"})

in

    #"Expanded Custom"

 

The character with the same color should be the same name.

Please look at my pbix for reference.

 

Best Regards

Maggie

 

View solution in original post

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

Hi @Thejeswar

To expand the needed list to a new query from the sublists for list A without happening on top of the existing List A, please create a blank query, then in advanced editor, input the following code.

let
    Source = Table1,
    #"Added Custom" = Table.AddColumn(Source, "Custom", each Table.FromList([Custom1],Record.FieldValues)),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"somethng", "DateStart", "DateEnd", "Custom1", "Custom2"}),
    #"Expanded Custom" = Table.ExpandTableColumn(#"Removed Columns", "Custom", {"Column1", "Column2"}, {"Custom.Column1", "Custom.Column2"})
in
    #"Expanded Custom"

Best Regards

Maggie

Hi,

I did this. But it is giving me error that "cannot convert Value of type Record to Type Table"

 

What could be the reason?

 

 

let
    Source = #"MySource",
    #"Added Custom" = Table.AddColumn(Source, "Custom", each Table.FromList([Custom1],Record.FieldValues)),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"somethng", "DateStart", "DateEnd", "ColumnA", "ColumnB"}), #"Expanded Atr" = Table.ExpandTableColumn(#"Removed Columns", "Atr", {"Id", "Title"}, {"Atr.Id", "Atr.Title"}), #"Removed Errors" = Table.RemoveRowsWithErrors(#"Expanded Atr", {"Atr.Id"}), #"Removed Duplicates" = Table.Distinct(#"Removed Errors", {"Atr.Id"}) in #"Removed Duplicates"

 

This is my M-Query for reference.

 

Hi @Thejeswar

I can reproduce your problem.

Please pay attention to the characters colored.

let

    Source = Table1,

    #"Added Custom" = Table.AddColumn(Source, "Custom", each Table.FromList([Custom1],Record.FieldValues)),

    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"somethng", "DateStart", "DateEnd", "Custom1", "Custom2"}),

    #"Expanded Custom" = Table.ExpandTableColumn(#"Removed Columns", "Custom", {"Column1", "Column2"}, {"Custom.Column1", "Custom.Column2"})

in

    #"Expanded Custom"

 

The character with the same color should be the same name.

Please look at my pbix for reference.

 

Best Regards

Maggie

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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