连接到用于 Power BI 应用工作区的 OneDrive 中存储的文件Connect to files stored in OneDrive for your Power BI app workspace

在 Power BI 中创建应用工作区后,可以将 Excel、CSV 和 Power BI Desktop 文件存储在 Power BI 应用工作区的 OneDrive for Business 上。After you've created an app workspace in Power BI, you can store your Excel, CSV, and Power BI Desktop files on the OneDrive for Business for your Power BI app workspace. 可以继续更新已存储在 OneDrive 中的文件,这些更新会按文件自动反映在 Power BI 报表和仪表板中。You can continue updating the files you store in OneDrive, and those updates are automatically reflected in the Power BI reports and dashboards based on the files.

将文件添加到应用工作区是一个分两步执行的过程:Adding files to your app workspace is a two-step process:

  1. 首先将文件上传到应用工作区的 OneDrive for BusinessFirst you upload files to the OneDrive for Business for your app workspace.
  2. 然后从 Power BI 连接到这些文件Then you connect to those files from Power BI.

备注

应用工作区仅适用于 Power BI ProApp workspaces are only available with Power BI Pro.

1 将文件上传到应用工作区的 OneDrive for Business1 Upload files to the OneDrive for Business for your app workspace

  1. 在 Power BI 服务中,选择“工作区”旁边的箭头,然后选择你的工作区名称旁边的省略号(“…”)。In the Power BI service, select the arrow next to Workspaces > select the ellipsis () next to your workspace name.

  2. 选择“文件”以在 Office 365 上打开应用工作区的 OneDrive for Business。Select Files to open the OneDrive for Business for your app workspace on Office 365.

    备注

    如果在应用工作区菜单上看不到“文件”,请选择“成员”打开应用工作区的 OneDrive for Business。If you don't see Files on the app workspace menu, select Members to open the OneDrive for Business for your app workspace. 然后,选择“文件”。There, select Files. Office 365 为你的应用的组工作区文件设置 OneDrive 存储位置。Office 365 sets up a OneDrive storage location for your app's group workspace files. 此过程可能需要一段时间才能完成。This process may take some time.

  3. 可以在此处将文件上传到应用工作区的 OneDrive for Business。Here, you can upload your files to the OneDrive for Business for your app workspace. 选择“上传”,并导航到你的文件。Select Upload, and navigate to your files.

2 导入 Excel 文件作为数据集或 Excel Online 工作簿2 Import Excel files as datasets or as Excel Online workbooks

现在文件位于你的应用工作区的 OneDrive for Business 中,你可以进行选择。Now that your files are in the OneDrive for Business for your app workspace, you have a choice. 你可以:You can:

导入或连接到你的应用工作区中的文件Import or connect to the files in your app workspace

  1. 在 Power BI 中,切换到应用工作区,让应用工作区名称显示在左上角。In Power BI, switch to the app workspace, so the app workspace name is in the top-left corner.
  2. 在左侧导航窗格底部选择“获取数据”。Select Get Data at the bottom of the left navigation pane.

  3. 文件框中,选择获取In the Files box, select Get.

  4. 选择“OneDrive” - “应用工作区名称”。Select OneDrive - Your App Workspace Name.

  5. 选择所需的文件,然后选择“连接”。Select the file you want > Connect.

    这时候需要你决定是从 Excel 工作簿导入数据,还是连接到整个 Excel 工作簿This is the point where you decide whether to import the data from the Excel workbook, or connect to the whole Excel workbooks.

  6. 选择“导入”或“连接”。Select Import or Connect.

  7. 如果选择“导入”,则该工作簿会显示在“数据集”选项卡上。If you select Import, then the workbook appears on the Datasets tab.

    如果选择“连接”,则该工作簿会位于“工作簿”选项卡上。If you select Connect, then the workbook is on the Workbooks tab.

后续步骤Next steps