Forum Discussion
DataSource.Error: An IO error occurred while trying to access the file...
- 9 years ago
Hi ccsrtw,
It seems folders exist in SharePoint online, please try the SharePoint Folder data source instead of Folder data source. See:
Best Regards,
Qiuyun Yu
v-qiuyu-msft - I created a .pbix file and copy/pasted the code into a blank query:
let
//Choose folder
Source = Folder.Files("\\PATH"),
//filter out all but Excel files
#"Filtered Rows" = Table.SelectRows(Source, each ([Extension] = ".xlsx")),
//sort in descending order by date modified
#"Sorted Rows" = Table.Sort(#"Filtered Rows",{{"Date modified", Order.Descending}}),
output = #"Sorted Rows"{0}[Name]
in
output
Received an identical error:
DataSource.Error: An IO error occurred while trying to access the file '\\PATH'.
Details:
PATH
Really odd. Frustrating that this worked initially and now isn't for no apparent reason!
Again, appreciate all of your help.
Hi ccsrtw,
I mean recreate .pbix is to click Get Data and choose Folder data source to retrieve data, instead of pasting original Power Query. I want to check if the issue is related to the folder path or Power Query. Please let me know the test result.
Also please try to update the desktop to the newest version 2.40.4554.463.
Best Regards,
Qiuyun Yu
- ccsrtw9 years agoAdvocate I
Morningv-qiuyu-msft,
I updated to the latest version. Went through the Get Data > Folder process and received the exact same error. Does this imply an issue with the path?
Thank you for following up!
- v-qiuyu-msft9 years agoCommunity Support
Hi ccsrtw,
Did you add any new files into this folder? Except Excel file(.xls/xlsx), Power BI file(.pbix) and Comma Separated Value (.csv) file, please remove other files then try again. Make sure all files are not opened with other applications.
Best Regards,
Qiuyun Yu- ccsrtw9 years agoAdvocate I
v-qiuyu-msft - thanks for sticking with me!
I did everything in your last post, but it's still hitting me with the same error.
After some more digging, I discovered this post: https://medium.com/@Konstantinos_Ioannou/onedrive-powerbi-desktop-use-valid-paths-to-import-data-stored-in-onedrive-for-business-60089848e594#.s5xlmfyq9
I was able to import the file itself via Get Data > Web:
let Source = Excel.Workbook(Web.Contents("http://companydomain-my.sharepoint/personal/user_companydomain_com/Documents/Folder/File.xlsx"), null, true) in SourceSo now all I need to do is step back a bit and get the name of that .xlsx file as the output. I tried:
let Source = Folder.Files(Web.Contents("http://companydomain-my.sharepoint.com/personal/user_companydomain_com/Documents/Folder"), null, true) in Sourcebut no go.