刷新使用 OneDrive 或 SharePoint Online 上的 .CSV 文件创建的数据集Refresh a dataset created from a .CSV file on OneDrive or SharePoint Online

有什么好处?What are the advantages?

当连接到 OneDrive 或 SharePoint Online 上的 .csv 文件时,将在 Power BI 中创建数据集。When you connect to a .csv file on OneDrive or SharePoint Online, a dataset is created in Power BI. 然后,.csv 文件中的数据将导入 Power BI 中的数据集。Data from the .csv file is then imported into the dataset in Power BI. Power BI 将自动连接到该文件,并使用 Power BI 中的数据集刷新任何更改。Power BI then automatically connects to the file and refreshes any changes with the dataset in Power BI. 如果在 OneDrive 或 SharePoint Online 中编辑 .csv 文件,则在保存之后,通常大约一小时,这些更改将在 Power BI 中显示。If you edit the .csv file in OneDrive, or SharePoint Online, once you save, those changes will appear in Power BI, usually within about an hour. Power BI 中基于数据集的任何可视化效果也会自动更新。Any visualizations in Power BI based on the dataset are automatically updated too.

如果你的文件位于 OneDrive for Business 或 SharePoint Online 上的共享文件夹中,那么其他用户可处理同一文件。If your files are in a shared folder on OneDrive for Business, or SharePoint Online, other users can work on the same file. 在保存之后,Power BI 中将自动更新所做的任何更改,通常在一小时之内。Once saved, any changes made are automatically updated in Power BI, usually within an hour.

许多组织都运行自动查询数据库的进程,数据库中的数据每天都保存到 .csv 文件中。Many organizations run processes that automatically query databases for data that is then saved to a .csv file each day. 如果该文件存储在 OneDrive 或 SharePoint Online 中,那么每天都将覆盖同一文件,而不是每天都创建一个具有不同名称的新文件,你可以在 Power BI 中连接该文件。If the file is stored on OneDrive, or SharePoint Online, and the same file is overwritten each day, as opposed to a new file with a different name being created each day, you can connect to that file in Power BI. OneDrive 或 SharePoint Online 上的文件更新后将立即同步连接到此文件的数据集。Your dataset that connects to the file will be synchronized soon after the file on OneDrive, or SharePoint Online, is updated. 基于此数据集的任何可视化效果也会自动更新。Any visualizations based on the dataset are automatically updated too.

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

逗号分隔值文件是简单的文本文件,因此,不支持连接到外部数据源和报表。Comma separated value files are simple text files, so connections to external data sources and reports are not supported. 你无法对使用逗号分隔文件创建的数据集的刷新制定计划。You cannot schedule refresh on a dataset created from a comma delimited file. 但是,当文件在 OneDrive 或 SharePoint Online 中时,Power BI 将自动每隔一小时向数据集同步对文件的任何更改。However, when the file is on OneDrive, or SharePoint Online, Power BI will synchronize any changes to the file with the dataset automatically about every hour.

OneDrive 或 OneDrive for Business。OneDrive or OneDrive for Business. 有什么区别?What’s the difference?

如果同时拥有个人版 OneDrive 和 OneDrive for Business,建议将 Power BI 中要连接到的任何文件保存在 OneDrive for Business 中。If you have both a personal OneDrive and OneDrive for Business, it’s recommended you keep any files you want to connect to in Power BI on OneDrive for Business. 原因如下:你有可能使用两个不同的帐户登录到它们。Here’s why: You likely use two different accounts to sign into them.

连接到 Power BI 中的 OneDrive for Business 通常是无缝的,因为你用于登录 Power BI 的同一个帐户通常是用来登录 OneDrive for Business 的同一个帐户。Connecting to OneDrive for Business in Power BI is typically seamless because the same account you use to sign into Power BI with is often the same account used to sign into OneDrive for Business. 但使用个人 OneDrive 时,你可能需要使用其他 Microsoft 帐户才能登录。But, with personal OneDrive, you likely sign in with a different Microsoft account.

登录 Microsoft 帐户时,请确保选中“保持我的登录状态”。When you sign into your Microsoft account, be sure to select Keep me signed in. 然后 Power BI 将与 Power BI 中的数据集同步任何更新Power BI can then synchronize any updates with datasets in Power BI

如果由于 Microsoft 帐户凭据可能已更改而无法将 OneDrive 上的 .csv 文件的更改与 Power BI 中的数据集进行同步,那么你需要连接到该文件并再次从个人 OneDrive 中导入该文件。If you make changes to your .csv file on OneDrive that cannot be synchronized with the dataset in Power BI because your Microsoft account credentials might have changed, you’ll need to connect to the file and import it again from your personal OneDrive.

出现问题时When things go wrong

如果 OneDrive 上的.csv 文件中的数据发生更改,并且这些更改反映未在 Power BI 中反映,那么很可能是因为 Power BI 无法连接到 OneDrive。If data in the .csv file on OneDrive is changing and those changes aren’t being reflected in Power BI, it’s most likely because Power BI cannot connect to your OneDrive. 请尝试连接该文件并再次导入。Try connecting to the file and importing it again. 如果系统提示你登录,请确保选中保持我的登录状态If you’re prompted to sign in, make sure you select Keep me signed in.

后续步骤Next steps

用于解决刷新问题的工具 刷新方案故障排除Tools for troubleshooting refresh issues Troubleshooting refresh scenarios

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