首页 > 解决方案 > 如何将文件保存到我的系统或直接连接到 PowerBI

问题描述

所以我在 Chrome 上的 Jupyter Notebook 中读取了一个 CSV 文件(使用 pd.read_csv())

它由大约 86,000 行和大约 5 列组成。它是数字和字符串数据的混合体。我清理/操作它添加一列并删除空值。

我现在希望在我的 PowerBI 中连接这些数据以将其可视化。

我可以将其保存为我的计算机中的 JSON 文件,然后将其上传到 powerBI 中吗?

有没有办法直接将所有内容转储到 PowerBI 报告中?

我有哪些选择?

标签: pythonpowerbi

解决方案


您可以在 PowerBI webapp 中复制并粘贴报表的内容

将 CSV 内容复制到 power bi 报告

准备好报告后,保存它,您可以通过安装 powerbiclient 库使用 jupyter notebook book 访问 Power BI 报告

from powerbiclient.authentication import DeviceCodeLoginAuthentication
device_auth = DeviceCodeLoginAuthentication()
token_with_device_code = device_auth.get_access_token()

group_id='ca8b6b59-919d-4f7e-92a2-eab66a7dd536' #your groupid in workspace
report_id='5cb9a453-b3b0-4695-98c9-98ed8f7ad4ba' #your report id in workspace 
report=Report(group_id=group_id,report_id=report_id,auth=device_auth)
report

如果遇到困难,您可以参考我关于如何在 jupyter notebook 中连接 powerBI 报告的帖子


推荐阅读