从相对路径将数据加载到 Power BI

Nel*_*ias 12 powerbi

我试图找到一种解决方案来加载外部数据文件,但从相对路径加载,因此当其他人打开我的 PBIX 时,它仍然可以在他/她的计算机上运行。

非常感谢。

Cai*_*ete 12

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

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

创建空白查询

输入文件路径

创建变量后,编辑 中的每个表Advanced Editor并将变量与文件名连接起来。

例如,而不是"C:\Users\augustoproiete\Desktop\data.xlsx",将其更改为dataFolderPath & "\data.xlsx"

在此处输入图片说明


您还可以投票/观看此功能请求,以便在实施时收到通知:


小智 5

您也可以使用“参数”功能。1.创建一个新的参数,如“PathExcelFiles” Parameter_ScreenShot

  1. 编辑您的“来源”条目 SourceEntry_ScreenShot

完毕 !