Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
bloffet
Frequent Visitor

Loop through a SharePoint list and build one query per item in that list.

Hi all,

 

I have as a need to connect to muliple SharePoint sites and look at the "Pages" library of each of those sites to perform certain actions/reporting in Power BI.

 

The way I'm doing this now is to manually create one data source connection per site and look into the page library of each site.

This is working fine, but I'd like to make this process dynamic, as I could have additional SharePoint sites in the future.

 

I was thinking to use a SharePoint list to store all sharepoint site urls, and loop trhough that list with Power BI to build my different queries.

 

 

Is this something that is possible ? If yes, could you give me some pointers on how to start ?

Thanks for your answer.

1 ACCEPTED SOLUTION
Michal_cwiok
Resolver II
Resolver II

It is possible. You can access those URLS using Custom Functions. Moreover, you can make it conditional i.e. if url contains some text, apply function1, otherwise function 2. I tried to cover it here and here.

 

If you paste more info, perhaps we can help you with writing such a query.

 

Thanks,
Michal

View solution in original post

2 REPLIES 2
Michal_cwiok
Resolver II
Resolver II

It is possible. You can access those URLS using Custom Functions. Moreover, you can make it conditional i.e. if url contains some text, apply function1, otherwise function 2. I tried to cover it here and here.

 

If you paste more info, perhaps we can help you with writing such a query.

 

Thanks,
Michal

Hello Michal,

 

Thanks a lot for your useful answer.

I think I'll be able to build what I want, if not I'll come back to you.

 

Have a nice day

Benoît

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.