Hi I am currently trying to develop a reporting tool. There is a SharePoint online list which has various SharePoint sites in that list. My objective is to retrieve all SharePoint sites from that list and to connect to the documents folder of all retrieved SharePoint sites. I am able to connect to all documents in Power Bi desktop but the refresh fails on the Power Bi service saying - Unable to refresh the model because it references an unsupported data source.
Here is the logic that i am using to connect to the document folder of all sites.
Main Query -
let
Source = SharePoint.Tables("https://xxxxx.sharepoint.com/sites/Projects/", [ApiVersion = 15]),
#"xxxxxxxxxxxxxx" = Source{[Id="xxxxxxxxxxxxxx"]}[Items],
#"Renamed Columns" = Table.RenameColumns(#"xxxxxxxxxxxxxx",{{"ID", "ID.1"}}),
#"Expanded SiteUrl" = Table.ExpandRecordColumn(#"Renamed Columns", "SiteUrl", {"Description", "Url"}, {"SiteUrl.Description", "SiteUrl.Url"}),
#"Removed Other Columns" = Table.SelectColumns(#"Expanded SiteUrl",{"Title", "Id","SiteStatus","ProjectCode", "SiteUrl.Url"}),
#"Documents" = Table.AddColumn(#"Filtered Rows2", "Documents", each GetList([SiteUrl.Url], "Documents"))
in
#"Documents"
Below is the code for GetList function -
= (siteURL,listname) =>
let
Source = SharePoint.Tables(siteURL,[ApiVersion = 15]),
#"MyListData" = Source{[Title=listname]}[Items]
in
#"MyListData"
I have taken help from this article which is very well written. https://marque360.com/aggregating-sharepoint-list-data-in-power-bi/ I am not sure why this works on Power Bi desktop but says unsupported data source on Power BI service. Could anyone please guide me on how to get this refresh working on Power BI service.