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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Tom_Y
Advocate II
Advocate II

Fail to get all the data from 250+ columns after expand

Hi. I do need some help. Thanks.

The code is not very complicated but I suddenly find that I did't get all the columns from the source files

There're 5 excel files for Year 2020 - 2024, all in same folder in sharepoint.

Actually they're in same format, same headers, over 250 columns.

 

let
Source = SharePoint.Contents("https://xxxx.sharepoint.com/sites/Projects", [ApiVersion = 15]),
#"Shared Documents" = Source{[Name="Shared Documents"]}[Content],
#"xxx Dashboard" = #"Shared Documents"{[Name="xxx Dashboard"]}[Content],
#"xxxx Advice" = #"xxx Dashboard"{[Name="xxxx Advice"]}[Content],
#"Filtered Rows" = Table.SelectRows(#"xxxx Advice", each Text.StartsWith([Name], "xxxx Advice all xxxx")),
#"Removed Other Columns1" = Table.SelectColumns(#"Filtered Rows",{"Content"}),
#"Filtered Hidden Files1" = Table.SelectRows(#"Removed Other Columns1", each [Attributes]?[Hidden]? <> true),
#"Invoke Custom Function1" = Table.AddColumn(#"Filtered Hidden Files1", "Transform File", each #"Transform File"([Content])),
PreExpand = Table.SelectColumns(#"Invoke Custom Function1",{"Transform File"}),
HEADINGS = List.Buffer(List.Union(List.Transform(PreExpand[Transform File], each Table.ColumnNames(_)))),
ReadyToExpand = PreExpand,
#"Expanded Transform File" = Table.ExpandTableColumn(ReadyToExpand, "Transform File", HEADINGS),

 

after this step, all the excels are combined, but then 3 out of that 5 files only load the first 246 columns, and all columns after that is all "null".

I've tried to restrict the filter so only 1 excel is remained, and the problem still exist. So the problem exists before expand.

When I preview the table in #"Invoke Custom Function1", the column is already missing.

 

Anyone can point me direction where to look into? The column headers seem normal.

 

Thank you so much!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Tom_Y 

 

#"Transform File" is a custom function which is binded to the #"Transform Sample File" query. The code of #"Transform File" is updated automatically according to the changes in the #"Transform Sample File" query. In #"Transform Sample File" query, you can do some transformations based on the sample file. These transformations will then be applied to all files in the folder before combining. This is done by invoking the #"Transform File" function in the combined query. 

vjingzhanmsft_0-1710728280215.png

So usually you need to check the result of the #"Transform Sample File" query. Ensure its result is ready for the file before combining. Selecting an appropriate file as sample file is also important as the Source step code is generated by analyzing the sample file. If a sample file contains fewer columns than other files, it will probably only get those columns for all files. But you can modify the code of #"Transform Sample File" query to change the result. 

 

I recommend that you modify the code in #"Transform Sample File". This can let you check the result after each step visibly. Otherwise if you modify #"Transform File" directly, this will break the binding and make it not updated according to #"Transform Sample File" any more. 

 

Best Regards,
Jing

View solution in original post

2 REPLIES 2
Tom_Y
Advocate II
Advocate II

I got it after a bad sleep. It's in the help folder --> Transform file

I don't know why, but it was restrcited to Columns=246, and I just change it to null

= (Parameter1 as binary) => let
Source = Csv.Document(Parameter1,[Delimiter=",", Columns=null, Encoding=65001, QuoteStyle=QuoteStyle.Csv]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true])
in
#"Promoted Headers"

 

Any way we can skip the "Transform file"?

Anonymous
Not applicable

Hi @Tom_Y 

 

#"Transform File" is a custom function which is binded to the #"Transform Sample File" query. The code of #"Transform File" is updated automatically according to the changes in the #"Transform Sample File" query. In #"Transform Sample File" query, you can do some transformations based on the sample file. These transformations will then be applied to all files in the folder before combining. This is done by invoking the #"Transform File" function in the combined query. 

vjingzhanmsft_0-1710728280215.png

So usually you need to check the result of the #"Transform Sample File" query. Ensure its result is ready for the file before combining. Selecting an appropriate file as sample file is also important as the Source step code is generated by analyzing the sample file. If a sample file contains fewer columns than other files, it will probably only get those columns for all files. But you can modify the code of #"Transform Sample File" query to change the result. 

 

I recommend that you modify the code in #"Transform Sample File". This can let you check the result after each step visibly. Otherwise if you modify #"Transform File" directly, this will break the binding and make it not updated according to #"Transform Sample File" any more. 

 

Best Regards,
Jing

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.

Top Solution Authors
Top Kudoed Authors