将 Power BI 数据警报与 Power Automate 集成

使用 Power Automate 将 Power BI 与你最喜爱的应用和服务相集成。 借助 Power Automate,可创建自动化工作流来获取通知、同步文件、收集数据等。 在本文中,你将基于 Power BI 数据警报自动生成电子邮件。

先决条件

本文介绍了如何创建两个不同的流:一个是通过模板创建,另一个是从头开始创建。 若要继续学习本教程,请在 Power BI 中创建数据警报注册 Power Automate。 它是免费的!

通过模板创建流

在此任务中,我们使用模板创建一个由 Power BI 数据警报(通知)触发的流。

  1. 登录 Power Automate (https://flow.microsoft.com)。

  2. 选择“模板”,搜索“Power BI”>“在触发 Power BI 数据警报时,向任何受众发送电子邮件”。

    Screenshot of the Power Automate Send an e-mail to any audience when a Power BI data alert is triggered template option.

生成流

此模板包含一个触发器、一个 Power BI 数据警报和一个用于发送电子邮件的操作。 在你选择字段的同时,Power Automate 会显示可以包含的动态内容。 在本示例中,我们在消息正文中添加磁贴值和磁贴 URL。

  1. 选择“继续”。

    Screenshot of the Power Automate, Power BI to mail option.

  2. 在“警报 ID”框中,选择一个 Power BI 数据警报。 若要了解如何创建警报,请参阅 Power BI 中的数据警报

    Screenshot that shows where to select an alert in the Alert ID box.

  3. 输入一个或多个有效的电子邮件地址。

  4. Power Automate 会自动为你生成主题正文,你可以保留它们,也可以修改它们。 正文文本使用 HTML 进行格式设置。

    Screenshot that shows the Power Automate auto-generated email text.

  5. 完成消息后,选择“新建步骤”或“保存”。 此时,Power Automate 会创建并计算流。

    Power Automate 会在有错误时提示你。

  6. 选择“编辑流”以修复错误。 否则,请选择“完成”以运行新流。

    Screenshot of the Power Automate success message.

  7. 当某个更改触发数据警报时,Power Automate 会向你指定的地址发送一封电子邮件。

    Screenshot of the Power Automate alert email.

从头开始创建流

在此任务中,我们从头开始创建一个由 Power BI 数据警报(通知)触发的简单流。

  1. 登录到 Power Automate

  2. 选择“创建”>“自动流”。

    Screenshot of the Power Automate > Create Automated cloud flow screen.

  3. 在“生成自动流”中,为流指定名称。

  4. 在“选择流的触发器”中,搜索“Power BI”。

  5. 选择“Power BI - 触发数据驱动警报时”>“创建”。

    Screenshot of the Build an automated flow screen.

生成流

  1. 在“警报 ID”框中,选择你的警报的名称。 若要了解如何创建警报,请参阅 Power BI 中的数据警报

    Screenshot that shows how to select the name of the alert.

  2. 选择“新建步骤”。

  3. 在“选择操作”中,搜索“Outlook”>“创建事件”。

    Screenshot that shows how to choose an action when you create an event.

  4. 填写事件字段。 在你选择字段的同时,Power Automate 会显示可以包含的动态内容。

    Screenshot that shows where to continue to build the flow.

  5. 完成后,选择“创建流”。 此时,Power Automate 会保存并计算流。 如果没有错误,请选择“完成”运行此流。 此时,系统会将这一新流添加到“我的流”页中。

    Screenshot of the message that indicates the flow is now running.

  6. 当 Power BI 数据警报触发流时,你会收到如下 Outlook 事件通知。

    Screenshot of the Power Automate triggers Outlook notification.