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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Query Connection path partial change

Hi everyone,

 

I have excel reports using CSV connection string. All my files sit within a folder structure like so IO-SQL-01\\D$\Folder\Subfolder\source.csv

There are multiple folders these files rest in like so IO-SQL-01\\D$\AnotherFolder\Subfolder\source.csv

Due to storage issues on the server I had to move my files to another server. 

IO-SQL-08-Dev\\D$\Folder\Subfolder\source.csv

I have been manually updating each file path in power BI when I change source I replace old path with new IO-SQL-08-Dev\\D$\

I retained the folder structure in new server.

 

Is it possible to write a powershell script to replace the server path while retaining folder structure path? Or do I just have to continue my manual process of opening each file and changing part of the path? Photo for reference. 

path powershell.JPG

1 ACCEPTED SOLUTION
v-yinliw-msft
Community Support
Community Support

Hi @Anonymous ,

 

You can try this method:

Click the New Parameter:

vyinliwmsft_0-1666084435902.png

vyinliwmsft_1-1666084549301.png

Give the parameter a name.

You should put the new address in the Current Value:

For example, your files' new address is IO-SQL-08-Dev\\D$\Folder\Subfolder\source.csv

And then you can change the absolute address to the new parameter name in the formula bar or advanced editor.

 

Tips: Note that the original absolute path address needs to be added in double quotation marks, and no quotation marks are required after changing to a parameter.

 

After each table is modified in this way, if the source file path changes, or if the address of the source file you saved is inconsistent with the PBIX file, you only need to change this parameter value. Then the addresses of all tables in PQ can be changed at once.

 

Hope this helps you.

 

Best Regards,

Community Support Team _Yinliw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yinliw-msft
Community Support
Community Support

Hi @Anonymous ,

 

You can try this method:

Click the New Parameter:

vyinliwmsft_0-1666084435902.png

vyinliwmsft_1-1666084549301.png

Give the parameter a name.

You should put the new address in the Current Value:

For example, your files' new address is IO-SQL-08-Dev\\D$\Folder\Subfolder\source.csv

And then you can change the absolute address to the new parameter name in the formula bar or advanced editor.

 

Tips: Note that the original absolute path address needs to be added in double quotation marks, and no quotation marks are required after changing to a parameter.

 

After each table is modified in this way, if the source file path changes, or if the address of the source file you saved is inconsistent with the PBIX file, you only need to change this parameter value. Then the addresses of all tables in PQ can be changed at once.

 

Hope this helps you.

 

Best Regards,

Community Support Team _Yinliw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Thank You!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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