Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Resident Rockstar
Resident Rockstar

Dynamically Set Data Source Links

The situation I have is that one department creates spreadsheets ~1x per month and puts them in a shared folder. Then the next year starts a new folder. I have a report that wants to use the most recent file from each year as data.  After manually updating the power query each month for a while, I decided that was too much effort, and have been trying to streamline the process.


So I changed to loading in a new excel sheet as the table 'SpreadsheetLinks', with the following format:

Report YearHyperlink{Dec2021Data}.xlsx{MostRecent2022Data}.xlsx


Which allows my power query to use this as a data source for each of my data tables, changing the year to match the data table:


Source = Excel.Workbook( Web.Contents( SpreadsheetLinks[Hyperlink]{ List.PositionOf(SpreadsheetLinks[Report Year], 2022, 0)}), null, true)


My original plan was to point the users to this new sheet, and let the other department update the link when the file is ready, and it would get caught in the next refresh. This works great when running in desktop and publishing. The issue is that I can no longer refresh the dataset in the PBI service, and get this error: This dataset includes a dynamic data source. Since dynamic data sources aren't refreshed in the Power BI service, this dataset won't be refreshed. 


I understand that this has to do with security concerns, and MS trying to avoid various problems that could arise from wantonly opening untested files.  I found solutions like this one using parameters that seem more suited to paginated API data, but I'm unsure how to use it to apply dynamic URL values stored in a separate file. 


At the end of the day, as long as I have an easy method to change the dataset's URL each month (preferably one that doesn't require me to open PBI Desktop and re-upload!) I'll be happy.

Super User
Super User

@Cmcmahan maybe the easier would be, after you list all the files, first add a step to sort by report date (z to a), in the next step, keep the first row, so you will be left with the most recent file, and then just expand it, no more, parameters etc will be required.


Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤

Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors