Skip to main content
Microsoft Idea

Power BI

Needs Votes

Support relative path to excel/csv sources

Vote (1111) 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 (85)
Boris Lipschitz's profile image Profile Picture

Alexey Korovianskii on 01 Sep 2022 21:48:18

RE: Support relative path to excel/csv sources

hmm, was really surprised it is not supported yet

Boris Lipschitz's profile image Profile Picture

Rafael Vieira de Oliveira on 11 Apr 2022 14:30:47

RE: Support relative path to excel/csv sources

Please add relative path capabilities!As sugestion: “/” - returns to the root directory and starts there “../” - moves one directory backwards and starts there “../../” - moves two directories backwards and starts there (and so on…)To move forward, just start with the first subdirectory and keep moving forward

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!