Forum Discussion
[DataSource.Error] Web.Contents failed to get contents from link not found
Hi Anonymous,
I am using Onedrive for business for connection and blank query for calling new excel file into it.
The following steps are :-
(i as number) as table =>
let
Source = Excel.Workbook(Web.Contents("https://azureneebal-my.sharepoint.com/personal/powerbi_ms_neebal_com/Documents/Arvind/excel file name" & Number.ToText(i) & ".xlsx"), null, true),
#"detailed_call_report_13-12-2017_Sheet" = Source{[Item="detailed_call_report_13-12-2017",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(#"detailed_call_report_13-12-2017_Sheet", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"call_start_time", type datetimezone}, {"call_end_time", type datetimezone}, {"call_created_by_employee", type text}, {"call_time_in_secs", Int64.Type}, {"customer_id", Int64.Type}, {"customer_name", type text}})
in
#"Changed Type"
After that you need to get data -> Blank query -> {1..10}
It gives list like,
1
2
3
.
.
10
Convert it to table after that add custom column first table([i])
Close and apply.
In above bold letter indicates that I have edited in advance editor to call multiple excel file into power bi desktop from OneDrive for business.
If you want anymore explanation then fell free to mail me.
Regards,
Arvind
First check if these files are available at urls
Use browser )
I see -
404 NOT FOUND
By the way, your url in first post differ from your last one
Your first url is
But url in M-code is
"https://azureneebal-my.sharepoint.com/personal/powerbi_ms_neebal_com/Documents/Arvind/excel file name" & Number.ToText(i) & ".xlsx"
Try to change this line
Source = Excel.Workbook(Web.Contents("https://azureneebal-my.sharepoint.com/personal/powerbi_ms_neebal_com/Documents/Arvind/excel file name" & Number.ToText(i) & ".xlsx"), null, true),to this one
Source = Excel.Workbook(Web.Contents("https://azureneebal-my.sharepoint.com/personal/powerbi_ms_neebal_com/_api/web/getfilebyserverrelativeurl('/personal/powerbi_ms_neebal_com/Documents/Arvind/Detail%20Call%20Report%20" & Number.ToText(i) & ".xlsx')/$value", [ManualStatusHandling={400..499}]), null, true),