在 Power BI 中使用 Azure 数据资源管理器数据

本文介绍将 Azure 数据资源管理器作为数据源连接到 Power BI 的不同方式。 连接后,你可以继续生成 Power BI 报表。

先决条件

连接模式

Power BI 支持导入和 DirectQuery 连接模式。 生成 Power BI 报表或仪表板时,请根据方案、规模和性能要求选择连接模式。 使用导入模式将数据复制到 Power BI。 相反,使用 DirectQuery 模式直接从 Azure 数据资源管理器群集查询数据。

在以下情况下使用导入模式:

在以下情况下使用 DirectQuery 模式:

  • 数据集较大,或者你需要准实时数据。

有关连接模式的详细信息,请参阅导入和 DirectQuery 连接模式

使用 Power BI 中的数据

可以通过以下方式将 Azure 数据资源管理器作为数据源连接到 Power BI:

  • 首先进入 Azure 数据资源管理器 Web UI,然后将数据粘贴到 Power BI Desktop 中。
  • 首先直接进入 Power BI Desktop,然后添加 Azure 数据资源管理器连接器。

在以下步骤中,我们将使用帮助群集中的 StormEvents 表来演示如何在 Power BI 中使用 Azure 数据资源管理器数据。

  1. 在 Azure 数据资源管理器 Web UI 的左侧菜单中选择“查询”,然后选择包含你的数据的数据库。

  2. 创建一个查询并将其选中。 例如,以下从 Samples>StormEvents 表运行的查询返回导致最严重农作物损害的风暴事件:

    StormEvents
    | sort by DamageCrops desc
    | take 1000
    
  3. 在“导出”菜单中,选择“Power BI 查询”。

    Screenshot of Azure Data Explorer web UI, showing the open Share menu with the Query to Power BI option highlighted.

  4. 启动 Power BI Desktop。

  5. 在“开始”选项卡上,选择“转换数据”。

    Screenshot of the Home tab in Power BI Desktop, with the Home tab option titled Transform data highlighted.

  6. 将查询粘贴到“导航器”窗格中。

    Screenshot of the Power BI Desktop Navigator pane, showing the drop-down menu of the right mouse button with the Paste option highlighted.

  7. (可选)可以将连接模式从“DirectQuery”更改为“导入”。 在“查询设置”窗口中的“已应用的步骤”下,选择“设置”齿轮图标。 有关详细信息,请参阅连接模式

    Screenshot of the Query Settings window, showing applied steps with the settings cog highlighted.

  8. 在“主页”选项卡上,选择“关闭并应用”

    Screenshot of the Home tab with the Close & Apply option highlighted.

下一步