Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

load data into power BI from relative path

Tags:

powerbi

I am trying to find a solution to load an external data file but from a relative path, so when someone else open my PBIX it will still work on his/her computer.

many thanks.

like image 952
Nelson Gomes Matias Avatar asked Oct 18 '18 16:10

Nelson Gomes Matias


2 Answers

Relative paths are *not* currently supported by Power BI.

power bi does not support relative paths


To ease the pain, you can create a variable that contains the path where the files are located, and use that variable to determine the path of each table. That way, you only have to change a single place (that variable) and all the tables will automatically point to the new location.

Create a Blank Query, give it a name (e.g. dataFolderPath) and type in the path where your files are (e.g. C:\Users\augustoproiete\Desktop)

create Blank Query

type path for the files

With the variable created, edit each of your tables in the Advanced Editor and concatenate your variable with the name of the file.

e.g. instead of "C:\Users\augustoproiete\Desktop\data.xlsx", change it to dataFolderPath & "\data.xlsx"

enter image description here


You can also vote/watch this feature request to be notified when it gets implemented:

  • Support relative path to excel/csv sources
like image 115
C. Augusto Proiete Avatar answered Sep 18 '22 14:09

C. Augusto Proiete


You can use also the "Parameters" function. 1. Create a new Parameter like "PathExcelFiles" Parameter_ScreenShot

  1. Edit your "Source" entry SourceEntry_ScreenShot

Done !

like image 41
Wil van Dorp Avatar answered Sep 18 '22 14:09

Wil van Dorp