Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello.
I built a "get files from folder" power query in/from my OneDrive personal 365. But now I've transferred that file and folders to my OneDrive business 365 premium on the web. And now can't figure out the folder path change in my M code. And, Sharepoint Folder is not available in "Get Data" for me in my business 365 for some reason so I can't use that option. I'm using a Dynamic Path in my workbook that works fine if I am using my personal 365 account, i.e. "C:" drive. M code shown below. But how do i get the same functionality in a web based 365 business OneDrive location? I've watched a ton of videos but nothing is working. I would be so thankful if anyone can help me here. Thank you in advance.
let
Source = Excel.CurrentWorkbook(){[Name="DynamicPath1.0"]}[Content],
Path = Source{0}[Dynamic Folder Path for Power Query Source],
GetFilesFromFolder = Folder.Files(Path),
#"Sorted Rows" = Table.Sort(GetFilesFromFolder,{{"Date created", Order.Descending}}),
#"Added Index" = Table.AddIndexColumn(#"Sorted Rows", "Index", 1, 1, Int64.Type),
#"Reordered Columns" = Table.ReorderColumns(#"Added Index",{"Index", "Content", "Name", "Extension", "Date accessed", "Date modified", "Date created", "Attributes", "Folder Path"}),
#"Split Column by Position" = Table.SplitColumn(#"Reordered Columns", "Name", Splitter.SplitTextByPositions({0, 4}, true), {"Name.1", "Name.2"}),
#"Changed Type" = Table.TransformColumnTypes(#"Split Column by Position",{{"Name.1", type text}, {"Name.2", type text}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"Name.2"})
in
#"Removed Columns"
OneDrive is just SharePoint under the covers, so you can use the SharePoint.Folder connector (instead of Folder.Files you may have used for your local files). Please see this article for how to get the url for your OneDrive account to use in SharePoint.Folder.
Pat
Hi, @Milestone ;
1.Navigate to your OneDrive for Business location using a browser. Select the ellipses (...) to open the More menu, then select Details.
2.In Power BI Desktop, select Get data > Web.
Note
To use a OneDrive for Business file as a data source in the Power BI service, with Service Refresh enabled for that file, make sure you select OAuth2 as the Authentication method when configuring your refresh settings. Otherwise, you may encounter an error (such as, Failed to update data source credentials) when you attempt to connect or to refresh. Selecting OAuth2 as the authentication method remedies that credentials error.
Use OneDrive for Business links in Power BI Desktop - Power BI | Microsoft Learn
If you want set dynamic link, you could refer to this.
Change the Source of Power BI Datasets Dynamically Using Power Query Parameters - RADACAD
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 9 | |
| 7 | |
| 7 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 22 | |
| 14 | |
| 11 | |
| 10 | |
| 9 |