我试图找到一种解决方案来加载外部数据文件,但从相对路径加载,因此当其他人打开我的 PBIX 时,它仍然可以在他/她的计算机上运行.
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.
非常感谢.
推荐答案Power BI 目前*不* 支持相对路径.
Relative paths are *not* currently supported by Power BI.
为了减轻痛苦,您可以创建一个包含文件所在路径的变量,并使用该变量来确定每个表的路径.这样,您只需更改一个位置(该变量),所有表都会自动指向新位置.
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.
创建一个空白查询,为其命名(例如 dataFolderPath)并输入文件所在的路径(例如 C:\Users\augustoproiete\Desktop)
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)
创建变量后,在 Advanced Editor 中编辑每个表,并将变量与文件名连接起来.
With the variable created, edit each of your tables in the Advanced Editor and concatenate your variable with the name of the file.
例如而不是 "C:\Users\augustoproiete\Desktop\data.xlsx",将其更改为 dataFolderPath &"\data.xlsx"
e.g. instead of "C:\Users\augustoproiete\Desktop\data.xlsx", change it to dataFolderPath & "\data.xlsx"
您还可以投票/观看此功能请求,以便在实施时收到通知:
You can also vote/watch this feature request to be notified when it gets implemented:
- 支持excel/csv源的相对路径
更多推荐
从相对路径将数据加载到 Power BI
发布评论