在 Power BI 中可视化来自 Azure 时序见解的数据Visualize data from Azure Time Series Insights in Power BI

Azure 时序见解是可在云中存储、管理、查询和可视化时序数据的平台。Azure Time Series Insights is a platform for storing, managing, querying, and visualizing time-series data in the cloud. Power BI 是一个业务分析工具,它提供丰富的可视化功能让你在组织中共享见解和结果。Power BI is a business analytics tool with rich visualization capabilities that allows you to share insights and results across your organization. 现在,这两项服务都可以集成,使你可以通过 Power BI 的强大数据可视化和轻松共享功能来增强 Azure 时序见解的强大分析能力。Both services can now be integrated allowing you to augment the powerful analytics of Azure Time Series Insights with the strong data visualization and easy sharing capabilities of Power BI.

将了解如何执行以下操作:You'll learn how to:

  • 使用本机 Azure 时序见解连接器将 Azure 时序见解连接到 Power BIConnect Azure Time Series Insights to Power BI using the native Azure Time Series Insights connector
  • 使用 Power BI 中的时序数据创建视觉对象Create visuals with your time-series data in Power BI
  • 将报表发布到 Power BI,然后与组织中的其他人共享Publish the report to Power BI and share with the rest of your organization

先决条件Prerequisites

请查看环境访问策略,并确保你具有对 Azure 时序见解 Gen2 环境进行直接访问或来宾访问的权限。Please review environment access policies and make sure you have either direct access or guest access to the Azure Time Series Insights Gen2 environment.

重要

  • 下载并安装最新版本的 Power BI DesktopDownload and install the latest version of Power BI Desktop. 若要按照本文中的步骤进行操作,请确保至少安装了 2020 年 12 月 (2.88.321.0) 版本的 Power BI Desktop。To follow along with the steps in this article, please make sure you have at least the December 2020 (2.88.321.0) version of Power BI Desktop installed.

将数据从 Azure 时序见解导出至 Power BI Desktop 中Export data from Azure Time Series Insights into Power BI desktop

开始操作:To get started:

  1. 打开 Azure 时序见解第 2 代资源管理器并策展数据。Open the Azure Time Series Insights Gen2 Explorer and curate your data. 这是将导出到 Power BI 的数据。This is the data that will be exported into Power BI.

  2. 创建满意的视图后,导航到“更多操作”下拉菜单,然后选择“连接到 Power BI” 。Once you have created a view you are satisfied with, navigate to the More actions dropdown menu and select Connect to Power BI.

    Azure 时序见解第 2 代资源管理器导出Azure Time Series Insights Gen2 Explorer export

  3. 设置导出参数:Set your parameters for export:

    • 数据格式:选择是要将“聚合数据”还是“原始事件”导出到 Power BI 。Data format: Choose whether you want to export Aggregate data or Raw events to Power BI.

      备注

      如果导出原始事件,则可以稍后在 Power BI 中聚合该数据。If you export raw events, you can aggregate that data later in Power BI. 但是,如果导出聚合数据,则无法在 Power BI 中还原到原始数据。However, if you export aggregate data, you cannot revert to raw data in Power BI. 原始事件级别数据的事件计数限制为 250,000 个。There is a 250,000 event count limit for Raw Event level data.

    • 时间范围:选择要在 Power BI 中查看“固定”时间范围数据还是“最新”时间范围数据 。Time Range: Choose whether you'd like to see a fixed time range or the latest data in Power BI. 选择固定时间范围意味着你所绘制的搜索范围内的数据将导出到 Power BI。Choosing the fixed time range means the data in the search span you've charted will be exported to Power BI. 选择最新时间范围意味着 Power BI 将获取所选搜索范围内的最新数据(例如,如果你绘制任意 1 小时的数据并选择“最新”设置,则 Power BI 连接器将始终查询最新 1 小时的数据。)Choosing the latest time range means that Power BI will grab the latest data for the search span you've chosen (e.g. If you chart any 1 hour of data and choose the "latest" setting, Power BI Connector will always make queries for the latest 1 hour of data.)

    • 存储类型:选择是要对“暖存储”还是“冷存储”运行所选查询 。Store Type: Choose whether you'd like to run your selected query against Warm Store or Cold Store. 如果选择范围同时跨越冷存储和暖存储,则默认情况下会将查询路由到冷存储,因为暖存储只包含最新的数据。If you've selected a range that spans both Cold and Warm stores, your query will be routed to Cold Store by default since Warm store will contain only the latest data. 可以手动更改 storeType 参数,但建议采用默认设置以获得最佳体验。Manually changing the storeType parameter is allowed, but not recommended for best experience.

    提示

    Azure 时序见解资源管理器将根据搜索范围以及你选择导出的数据视图自动选择建议的参数。Azure Time Series Insights Explorer will automatically select the recommended parameters depending on the search span and view of data you've chosen to export.

  4. 配置设置后,选择“将查询复制到剪贴板”。Once you have configured your settings, select Copy query to clipboard.

    Azure 时序见解资源管理器导出模式Azure Time Series Insights Explorer export modal

  5. 启动 Power BI Desktop。Launch Power BI Desktop.

  6. 在 Power BI Desktop 中的“主页”选项卡上,选择左上角的“获取数据”,然后选择“更多”。In Power BI Desktop on the Home tab, select Get Data in the upper left corner, then More.

    在 Power BI 中获取数据Get data in Power BI

  7. 搜索“Azure 时序见解”,依次选择“Azure 时序见解(Beta)”、“连接”。 Search for Azure Time Series Insights, select Azure Time Series Insights (Beta), then Connect.

    将 Power BI 连接到 Azure 时序见解Connect Power BI to Azure Time Series Insights

    或者,导航到“Azure”选项卡,并依次选择“Azure 时序见解(Beta)”、“连接”。Alternatively, navigate to the Azure tab, select Azure Time Series Insights (Beta), then Connect.

  8. 将从 Azure 时序见解资源管理器复制的查询粘贴到“自定义查询”字段中,然后按“确定” 。Paste the query you copied from Azure Time Series Insights Explorer into the Custom Query field, then press OK.

    粘贴自定义查询并选择“确定”Paste in the custom query and select OK

  9. 随即会加载数据表。The data table will now load. 按“加载”以载入 Power BI。Press Load to load into Power BI. 如果要对数据进行任何转换,现在可以通过单击“转换数据”来执行此操作。If you wish to make any transformations to the data, you can do so now by clicking Transform Data. 还可以在加载数据后对其进行转换。You can also transform your data after it's loaded.

    查看表中的数据并选择“加载”Review the data in the table and select Load

使用视觉对象创建报表Create a report with visuals

将数据导入 Power BI 后,接下来请生成包含视觉对象的报表。Now that you have imported the data into Power BI, it’s time to build a report with visuals.

  1. 在窗口的左侧,确保已选择“报表”视图。On the left side of the window, make sure you have selected the Report view.

    屏幕截图显示“报表”视图图标。Screenshot shows Report view icon.

  2. 在“可视化效果”列中,选择所需的视觉对象。In the Visualizations column, select your visual of choice. 例如,选择“折线图”。For example, select Line chart. 这会在画布中添加一个空白的折线图。This will add a blank line chart to your canvas.

  3. 在“字段”列表中选择“时间戳(_T)”,然后将此时间戳拖放到“轴”字段以显示 X 轴上的时间 。In the Fields list, select _Timestamp and drag it to the Axis field to display time along the X-axis. 确保切换到“_时间戳”,作为“轴”的值(默认为“数据层次结构”) 。Make sure to switch to _Timestamp to as the value for the Axis (default is Date Hierarchy).

    选择”时间戳(_T)”Select _Timestamp

  4. 同样,在“字段”列表中选择要绘制的变量,然后将此变量拖放到“值”字段以显示 Y 轴上的值 。Again, in the Fields list, select the variable you wish to plot and drag it to the Values field to display values along the Y-axis. 选择时序 ID 值并将其拖放到“图例”字段,以在图表中创建多行,每个时序 ID 一行。Select your Time Series ID value and drag it to the Legend field to create multiple lines in the chart, one per Time Series ID. 呈现结果将类似于 Azure 时序见解资源管理器提供的视图!This will render a view similar to what is provided by the Azure Time Series Insights Explorer!

    创建基本折线图Create a basic line chart

  5. 若要将另一个图表添加到画布,请选择画布上折线图外部的任意位置,并重复上述过程。To add another chart to your canvas, select anywhere on the canvas outside the line chart and repeat this process.

    创建要共享的其他图表Create additional charts to share

创建报表后,可将其发布到 Power BI Reporting Services 并与组织中的其他人共享。Once you have created your report, you can publish it to Power BI Reporting Services and share with others in your organization.

高级编辑Advanced editing

如果已在 Power BI 中加载了一个数据集,但想要修改查询(例如日期/时间或环境 ID 参数),可以通过 Power BI 的高级编辑器功能实现此目的。If you have already loaded a dataset in Power BI but would like to modify the query (such as the date/time or Environment ID parameters), you can do this via Power BI’s Advanced Editor functionality. 请参阅 Power BI 文档,了解有关如何使用 Power Query 编辑器进行更改的详细信息。Refer to the Power BI documentation to learn more about how to make changes using the Power Query Editor.

后续步骤Next Steps