禁用 Power Query 后台刷新Disable Power Query background refresh

本文主要面向使用 Power BI Desktop 的 Import 数据建模者。This article targets Import data modelers working with Power BI Desktop.

默认情况下,当 Power Query 导入数据时,它还会为每个查询缓存多达 1000 行的预览数据。By default, when Power Query imports data, it also caches up to 1000 rows of preview data for each query. 预览数据可帮助你快速预览源数据,以及查询的每个步骤的转换结果。Preview data helps to present you with a quick preview of source data, and of transformation results for each step of your queries. 它单独存储在磁盘上,而不是存储在 Power BI Desktop 文件中。It's stored separately on-disk and not inside the Power BI Desktop file.

但是,当 Power BI Desktop 文件包含多个查询时,检索和存储预览数据会延长完成刷新所需的时间。However, when your Power BI Desktop file contains many queries, retrieving and storing preview data can extend the time it takes to complete a refresh.

建议Recommendation

通过设置 Power BI Desktop 文件来更新后台的预览缓存,可以更快地进行刷新。You'll achieve a faster refresh by setting the Power BI Desktop file to update the preview cache in the background. 在 Power BI Desktop 中,通过选择“文件”>“选项和设置”>“选项”,然后选择“数据加载”页面来启用 。In Power BI Desktop, you enable it by selecting File > Options and settings > Options, and then selecting the Data Load page. 然后可以打开“允许在后台下载数据预览”选项。You can then turn on the Allow data preview to download in the background option. 请注意,仅可为当前文件设置此选项。Note this option can only be set for the current file.

显示背景数据选项的 Power BI Desktop 的屏幕截图。

启用后台刷新可能导致预览数据过期。Enabling background refresh can result in preview data becoming out of date. 如果发生这种情况,Power Query 编辑器会通过以下警告通知你:If it occurs, the Power Query Editor will notify you with the following warning:

Power BI Desktop 的屏幕截图,其中显示了关于旧预览数据的 Power Query 编辑器警告。

始终可以更新预览缓存。It's always possible to update the preview cache. 可以通过使用“刷新预览”命令来针对单个查询或所有查询进行更新。You can update it for a single query, or for all queries by using the Refresh Preview command. 你将在 Power Query 编辑器窗口的“主页”功能区中找到它。You'll find it on the Home ribbon of the Power Query Editor window.

Power BI Desktop 的屏幕截图,其中显示了用于刷新预览数据的 Power Query 编辑器命令。

后续步骤Next steps

有关本文的详细信息,请参阅以下资源:For more information related to this article, check out the following resources: