I hope you have solved your issue. For future reference I will share my solution to the error message that you (and I) have encountered.
I was using the web connection with the direct url to the Excel file on Sharepoint, like explained in this tutorial. However, after uploading the Power BI report to the service I was not able to authenticate against the Sharepoint resource.
After changing the direct web link to the Excel file to the Sharepoint Folder connector I was able to use OAuth2 authentication method.
Below is the (redacted) M code:
let
Source = SharePoint.Files("https://organizationname.sharepoint.com/sites/teamsite/", [ApiVersion = 15]),
ExcelFile = Source{[Name="SourceExcelName.xlsx",#"Folder Path"="https://organizationname.sharepoint.com/sites/teamsite/Shared Documents/path01/"]}[Content],
ImportExcelFile = Excel.Workbook(ExcelFile),
Sheet = ImportExcelFile{[Item="Targets",Kind="Sheet"]}[Data],
PromoteHeaders = Table.PromoteHeaders(Sheet, [PromoteAllScalars=true]),
ChangeDataType = Table.TransformColumnTypes(PromoteHeaders,{{"Source name", type text}, {"Source file name", type text}, {"Maximum", Int64.Type}})
in
ChangeDataType
Here is a link to a tutorial: https://powerbi.tips/2016/09/loading-excel-files-from-sharepoint/
Hope this help.