Skip to main content

Power BI

Needs Votes

Support relative path to excel/csv sources

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

Shawn Eary on 16 Feb 2023 16:51:34

RE: Support relative path to excel/csv sources

Need this for CSV/TSV/PSV flat files also.

Boris Lipschitz's profile image Profile Picture

Bob Harper on 13 Oct 2022 08:34:48

RE: Support relative path to excel/csv sources

Pesky analysts asking for complicated features like relative paths. Microsoft developers can't cater to every niche edge cases!

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.