刷新从本地驱动器的 Power BI Desktop 文件创建的数据集Refresh a dataset created from a Power BI Desktop file on a local drive

支持的功能有哪些?What’s supported?

在 Power BI 中,数据集是使用本地驱动器导入的 Power BI Desktop 文件创建的,它支持“立即刷新”和“计划刷新”功能。在本地驱动器中,“获取数据”/“查询编辑器”可用于连接到以下任一数据源并从以下任一数据源加载数据:In Power BI, Refresh Now and Schedule Refresh is supported for datasets created from Power BI Desktop files imported from a local drive where Get Data/Query Editor is used to connect to and load data from any of the following data sources:

Power BI Gateway - PersonalPower BI Gateway - Personal

  • Power BI Desktop“获取数据”和“查询编辑器”中显示的所有联机数据源。All online data sources shown in Power BI Desktop’s Get Data and Query Editor.
  • Power BI Desktop“获取数据”和“查询编辑器”中显示的所有本地数据源,Hadoop 文件 (HDFS) 和 Microsoft Exchange 除外。All on-premises data sources shown in Power BI Desktop’s Get Data and Query Editor except for Hadoop file (HDFS) and Microsoft Exchange.

本地数据网关On-premises data gateway

数据源Data source
Analysis Services 表格Analysis Services Tabular
Analysis Services 多维Analysis Services Multidimensional
SQL ServerSQL Server
SAP HANASAP HANA
OracleOracle
TeradataTeradata
文件File
文件夹Folder
SharePoint 列表(本地)SharePoint list (on-premises)
WebWeb
ODataOData
IBM DB2IBM DB2
MySQLMySQL
SybaseSybase
SAP BWSAP BW
IBM Informix 数据库IBM Informix Database
ODBCODBC

备注

必须安装一个网关并运行该网关,才能使 Power BI 连接到本地数据源并刷新数据集。A gateway must be installed and running in order for Power BI to connect to on-premises data sources and refresh the dataset.

你可以直接在 Power BI Desktop 中通过选择主页功能区上的“刷新”手动执行一次性刷新操作。You can perform a one-time, manual refresh right in Power BI Desktop by selecting Refresh on the Home ribbon. 选择此处的“刷新”时,将用原始数据源中更新后的数据刷新文件模型中的数据。When you select Refresh here, the data in the file’s model is refreshed with updated data from the original data source. 这种类型的刷新完全是从 Power BI Desktop 应用程序自身内部进行,不同于在 Power BI 中进行的手动或计划内刷新,理解这种区别至关重要。This kind of refresh, entirely from within the Power BI Desktop application itself, is different from manual or scheduled refresh in Power BI, and it’s important to understand the distinction.

当从本地驱动器导入 Power BI Desktop 文件时,此数据以及有关模型的其他信息将被加载到 Power BI 服务中的数据集。When you import your Power BI Desktop file from a local drive, data, along with other information about the model is loaded into a dataset in the Power BI service. 在 Power BI 服务中,而不是在 Power BI Desktop 中,建议刷新数据集中的数据,因为 Power BI 服务中的报表就是基于该数据集创建的。In the Power BI service, not Power BI Desktop, you want to refresh data in the dataset because that is what your reports, in the Power BI service, are based on. 由于该数据源是外部数据源,因此可以手动刷新该数据集,方法是通过使用立即刷新或者可以通过使用计划刷新设置刷新计划。Because the data sources are external, you can manually refresh the dataset by using Refresh now or you can setup a refresh schedule by using Schedule Refresh.

刷新数据集时,Power BI 不会连接到本地驱动器上的文件对更新后的数据进行查询。When you refresh the dataset, Power BI does not connect to the file on the local drive to query for updated data. 而是使用数据集中的信息直接连接到数据源对更新后的数据进行查询,然后再将其加载到数据集。It uses information in the dataset to connect directly to the data sources to query for updated data it then loads into the dataset.

备注

数据集中刷新的数据未同步回本地驱动器上的文件。Refreshed data in the dataset is not synchronized back to the file on the local drive.

如何设置计划刷新?How do I schedule refresh?

设置刷新计划时,Power BI 将使用数据集中的连接信息和凭据直接连接到数据源,以对更新后的数据进行查询,然后再将更新后的数据加载到数据集。When you setup a refresh schedule, Power BI will connect directly to the data sources using connection information and credentials in the dataset to query for updated data, then load the updated data into the dataset. 此外,还会更新基于 Power BI 服务中该数据集的报表和仪表板中的所有可视化效果。Any visualizations in reports and dashboards based on that dataset in the Power BI service are also updated.

有关如何设置计划刷新的详细信息,请参阅配置计划刷新For details on how to setup schedule refresh, see Configure Schedule Refresh.

出现问题时When things go wrong

出现问题时,通常是因为 Power BI 无法登录数据源,或数据集连接到本地数据源,而网关处于脱机状态。When things go wrong, it’s usually because Power BI can’t sign into data sources, or if the dataset connects to an on-premises data source, the gateway is offline. 确保 Power BI 可以登录数据源。Make sure Power BI can sign into data sources. 如果用于登录数据源的密码更改,或 Power BI 已从数据源注销,请务必在数据源凭据中再次尝试登录数据源。If a password you use to sign into a data source changes, or Power BI gets signed out from a data source, be sure to try signing into your data sources again in Data Source Credentials.

请确保选中刷新失败时发送电子邮件通知Be sure to leave the Send refresh failure notification email to me checked. 你会想立即了解计划刷新是否失败。You’ll want to know right away if a scheduled refresh fails.

故障排除Troubleshooting

有时可能不会按预期方式刷新数据。Sometimes refreshing data may not go as expected. 通常,这会是与网关连接出现的问题。Typically this will be an issue connected with a gateway. 请查看网关故障排除文章,了解相关工具和已知问题。Take a look at the gateway troubleshooting articles for tools and known issues.

本地数据网关疑难解答Troubleshooting the on-premises data gateway

Power BI Gateway - Personal 故障排除Troubleshooting the Power BI Gateway - Personal

更多问题?More questions? 尝试咨询 Power BI 社区Try asking the Power BI Community