Skip to main content
Microsoft Idea

Power BI

Needs Votes

Support relative path to excel/csv sources

Vote (1112) Share
Boris Lipschitz's profile image

Boris Lipschitz on 08 Sep 2015 10:25:40

Currently, when excel file is loaded to Power BI, the absolute filepath is captured in the M query. It would be nice if relative filepath was supported. Thus we could place excel file next to pbix and not worry about the file location (local machine, shared folder on server or onedrive)

Comments (83)
Boris Lipschitz's profile image Profile Picture

Kevin Rank on 01 Apr 2022 23:55:14

RE: Support relative path to excel/csv sources

This is feature I could REALLY use. Another option, would be relative paths, or the ability to use standard windows environment variables that have been around for a VERY long time. (Honestly, this is one I seriously don't understand why it is not available). Then, I could have users store their excel files in their %userprofile% .

Boris Lipschitz's profile image Profile Picture

Shai Radoshitzky on 27 Jan 2022 19:55:45

RE: Support relative path to excel/csv sources

This is a must have feature, now that you allowed having scheduled refresh on Excel file on One Drive.

Boris Lipschitz's profile image Profile Picture

Lara Balazs on 14 Dec 2021 11:57:36

RE: Support relative path to excel/csv sources

Desperately needed!!

Boris Lipschitz's profile image Profile Picture

Jenny Zhang on 05 Aug 2021 01:16:08

RE: Support relative path to excel/csv sources

I can't believe this is not implemented yet!

Boris Lipschitz's profile image Profile Picture

James Bartlett on 29 Jul 2021 21:40:39

RE: Support relative path to excel/csv sources

Power BI Desktop should have a Power Query keyword (like #shared), called something like #workingdirectory, which returns the current report file's working directory as an absolute path. That way, you wouldn't even need to use the report parameters at all. You'd just edit the Source line in the M query to look like this:
Source = Excel.Workbook(File.Contents(#workingdirectory & "ExcelFile.xlsx"), null, true)
Then, as long as the report PBIX and its data source files are kept together, and the source file names stay the same, the report will just work automatically, no matter who opens it or where it's saved in the filesystem. 😎thum

Boris Lipschitz's profile image Profile Picture

Guilherme Kermentz Ferraz Costa on 15 Jun 2021 14:21:00

RE: Support relative path to excel/csv sources

How come this is a not feature... This should've been implemented years ago.

Boris Lipschitz's profile image Profile Picture

Alejandro Contreras Sepulveda on 04 May 2021 22:50:45

RE: Support relative path to excel/csv sources

PowerBI is an exceptional tool, BUT developers need to change their mindset: advanced users? we are enthusiastic but too few to blow other tools (like QlikView or even think-cell) out of the water. The average user will always be unable to get inside the model and make changes without making a mess, but they are the many.

I spend a good part of the day explaining (among other basic things, like resetting filters) why they shouldn't change the folder the files are stored in, and how to change file paths, problems I didn't have with QlikView (Oh how I miss the old . and .. folder commands)

At this point, basic features such as this one should've been addressed.

Boris Lipschitz's profile image Profile Picture

AAB TRA on 03 May 2021 07:54:46

RE: Support relative path to excel/csv sources

Absolutely bizarre that this hasn't been implemented years ago!

Boris Lipschitz's profile image Profile Picture

Y0003974 f on 23 Apr 2021 22:43:43

RE: Support relative path to excel/csv sources

Need to package up a report and a folder with excel files in for a consumer. They have no technical expertise. Once they unzip the query will break due to the file paths. This is a basic requirement, c'mon!

Boris Lipschitz's profile image Profile Picture

Alejandro Medina Familia on 18 Mar 2021 16:34:17

RE: Support relative path to excel/csv sources

Please add relative path capabilities. This is such a powerful tool, but without relative path, non technical users need to manually set sources when sharing or moving the files. this introduces a lot of friction and more chances of things breaking.