cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pkoetzing Frequent Visitor
Frequent Visitor

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

Accepted Solutions
Highlighted
pkoetzing Frequent Visitor
Frequent Visitor

Re: How to switch sources within sharepoint folder

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

3 REPLIES 3
Highlighted
pkoetzing Frequent Visitor
Frequent Visitor

Re: How to switch sources within sharepoint folder

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

anacerco Frequent Visitor
Frequent Visitor

Re: How to switch sources within sharepoint folder

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?

pkoetzing Frequent Visitor
Frequent Visitor

Re: How to switch sources within sharepoint folder

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/

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 100 members 2,636 guests
Please welcome our newest community members: