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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
pkoetzing
Advocate III
Advocate III

How to switch sources within sharepoint folder

I'm using an Excel file with various tables as input source to my queries. As long as this file is stored on my local drive, I can simply switch to another file using "data source settings" - "change source". But when the file is located within a sharepoint folder I don't have that option. Instead I would have to change the path in every single query using the advanced editor. Is there any way to use a kind of "global parameter" in PowerBI so that this change needs to be done in one place only?

1 ACCEPTED SOLUTION
pkoetzing
Advocate III
Advocate III

Just figured it out myself: Goto "Query Editor". On "Manage Parameters" select "New Parameter" and enter a name, a list of values and a current value. Then in "Advanced Editor" simply refer to that parameter, e.g.

 

    File = Source{[Name=MyFileParameter,#"Folder Path"=MyPathParameter]}[Content]

 

 

View solution in original post

6 REPLIES 6
jaryszek
Post Prodigy
Post Prodigy

Hi Guys,

new idea for it:
https://community.fabric.microsoft.com/t5/Fabric-Ideas/Skip-Credential-Validation-for-Queries-Exclud...

Please vote!

It means that you can exclude query to be refreshed not only in power bi desktop - also within power bi service without failing because of data source credentials. 

Best,
Jacek

pkoetzing
Advocate III
Advocate III

Just figured it out myself: Goto "Query Editor". On "Manage Parameters" select "New Parameter" and enter a name, a list of values and a current value. Then in "Advanced Editor" simply refer to that parameter, e.g.

 

    File = Source{[Name=MyFileParameter,#"Folder Path"=MyPathParameter]}[Content]

 

 

Hello!

 

I have same issue and I am not exactly sure how you define a list of values for a parameter, could you please explain?

Hi,

 

Actually I wasn't using a list of values for one parameter, but different parameters for site_url, folder_name and file_name. But in the Power Query Editor you can go to 'Manage Paremeters' and under 'Suggested Values' select 'List of values' and then type your list in.

 

See an example here: https://powerbi.microsoft.com/de-de/blog/deep-dive-into-query-parameters-and-power-bi-templates/

if you can provide the m code for this example, that would be awesome.

 

Thanks for the share!

I figured it out, see below screenshot as reference. You can create parameters for each argument shown below in yellow and do not need to place (") or (&) symbols. In my case, all I needed was a parameter to toggle the filepath and left the other arguments alone.

 

2019-12-13_screenshot.png

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.