Forum Discussion
Anonymous
7 years agoNot applicable
connecting to sharepoint sub folder
Hi Team, I have a sharepoint site, lets call it ABC. within it I have over 100 subfolders, and i would only like to access one sub folder called "data test" when connecting to PowerBI Desktop. ...
Anonymous
3 years agoNot applicable
Hi RichardTam , Edson_Cruz94 , Chrisjm15 , Noivilbo -
I had this same issue today and was able to resolve by manually combining files in Power Query Editor (as noted by others, the wizard does not seem to include this functionality). Sharing the steps that worked for me below.
To add a SharePoint folder as a new source:
- Click Get Data > SharePoint folder
- Enter the root of the SharePoint site (example: https://sharepoint.com/sites/site)
- Click Transform Data (ignore the long list of files)
- In the Power Query Editor, filter the Folder Path column to only include the desired folder (search for the folder name and select it). The table should now have one row for each file in the SharePoint folder.
- On the Home tab of Power Query Editor, click Combine Files. If this button is grayed out, try clicking on another query then come back to this one, and then it should be active. This will create the same parameters and helper queries created by the wizard when using a local folder.
- Continue transforming data as needed.
To convert an existing local folder path to a SharePoint folder path without redoing the queries:
- Open Power Query Editor and select the Source (first step) of the primary query (NOT the helper query).
- Change Source path from = Folder.Files("C:\Users\path\data\") to = SharePoint.Files("https://site.com/sites/site", [ApiVersion = 15]). If this string does not work, you can find out what your string should be by creating a test connection to a SharePoint folder using the steps above, then copying the string that is generated to all queries that need to be moved.
- Filter the Folder Path column to only include the desired folder (search for the folder name and select it). If it's not possible to filter for the unique folder directly (if many results are returned), select only one folder and manually edit the filter text in the text bar of Power Query Editor to point to the desired folder.
- Query should now refresh from SharePoint instead of from the local folder.
Sorry, I don't have screenshots to share since the data in my example is proprietary.
renatogbarroso
2 years agoAdvocate I
Many Thanks, your explanation helped-me a lot!