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
MLangUK
Regular Visitor

Extracting all excel files in a Sharepoint Folder to it's own query

Hi,  newbie BI person here...

 

Short version: Can someone point me to a method to extract each excel file within a specified Sharepoint Folder to it's own query, please?

 

Long version:  I have a Sharepoint folder that excel file database reports, and want to simplify extracting each file within that folder to it's own query to be used in a BI dashboard. 

I have an initial query that outputs a list of the files in that location with a Content column showing Binary.

(= Table.SelectRows(Source, each [Folder Path] = "https://ourcompany.sharepoint.com/sites/Reporting/Shared Documents/Database Reports/")).

I right click on that field for each record and select Add As New Query, which shows me the Excel file object.

(= #"Filtered Rows"{[Name="Report1.xlsx",#"Folder Path"="https://ourcompany.sharepoint.com/sites/Reporting/Shared Documents/Database Reports/"]}[Content])

Right clicking on the icon and selecting Excel Workbook gives me a worksheet table, with a Data field listing Table.

= Excel.Workbook(#"Report1 xlsx_https://https://ourcompany.sharepoint.com/sites/Reporting/Shared Documents/Database Reports/")

There'll only be one worksheet, and a click on that Table value opens up the report (and then I make the first row headers).

= #"Imported Excel Workbook"{[Item="Page 1",Kind="Sheet"]}[Data]

 

So, my first ask is whether there's a good way to abbreviate that process?  Secondly, is there a good way of making it as easy as possible for someone to add to the available queries in the dataset - ideally by just adding a report to the Sharepoint folder and it appearing in the set, or by manually running a function on the initial file list in BI?

 

Currently, our database outputs scheduled reports via email. Power Automate picks up the emails and saves the attachments to Sharepoint.  I then create a new query in a dataset and pull the data through for use in dashboards.  It's that last step I want to make easier to reduce manual work needed.  Once it's done, we should be ok with just refreshing the set when the reports are overwritten.

 

Any help much appreciated.

ta

Matt

 

 

1 REPLY 1
v-cgao-msft
Community Support
Community Support

Hi @MLangUK ,

 

1. You can also nest multiple steps together as a single step, but this is not conducive to troubleshooting because they all actually behave the same way, but with different levels of complexity.

2. Please refer to:
Solved: Changing data source without effecting all query s...

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

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.

Top Solution Authors
Top Kudoed Authors