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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
gemcityzach
Helper IV
Helper IV

How to get SharePoint.Contents import in PowerQuery to preserve the file name of an XSLX as a field?

Hey folks,

I have a bunch of folders stored in SharePoint filled with various data, mostly in CSV. Each folder is a monthly snapshot of a different table from a database that we do not have a direct connection to.

 

Presently, we're importing the data into PowerBI using the SharePoint Folder import and CSV.Document import method. Each file is named with the date of the snap shot, like 02-01-2024.csv or 03-01-2024.csv. Some of the files are XSLX and while they have the same file names like '02-01-2024' they will have a tab named "export_name" or something like that.

 

During the import for CSV files, we get a tidy little column called Source.Name which is then converted to a date field for incremental refresh purposes. However, for the XLSX files, we're not getting that field on import. It's like PowerQuery is just dropping it.

 

Is there a way to get the file name added as a field during the import step?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@gemcityzach , Usually Power Query does not drop. But Source.Name can be name also generated because of some other field. Check if it got renamed and later dropped as not required columns in a step (remove columns)

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@gemcityzach , Usually Power Query does not drop. But Source.Name can be name also generated because of some other field. Check if it got renamed and later dropped as not required columns in a step (remove columns)

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Looks like PowerQuery did automatically drop that column but I was able to modify it in the Steps to fix it and add it back in

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.