向 Power BI 报表添加视觉对象(第 2 部分)Add visuals to a Power BI report (part 2)

适用对象:否面向消费者的 Power BI 服务 是面向设计师和开发者的 Power BI 服务 是Power BI Desktop 否需要 Pro 或 Premium 版许可证APPLIES TO: noPower BI service for consumers yesPower BI service for designers & developers yesPower BI Desktop noRequires Pro or Premium license

备注

可以在 Power BI Desktop 和 Power BI 服务中创建并查看这些视觉对象。These visuals can be created and viewed in both Power BI Desktop and the Power BI service. 本文中的步骤和图示来自 Power BI Desktop。The steps and illustrations in this article are from Power BI Desktop.

第 1 部分中,通过选中字段名称旁边的复选框来创建基本可视化对象。In Part 1, you created a basic visualization by selecting checkboxes next to field names. 在第 2 部分中,你将了解如何使用拖放功能并充分利用“字段”和“可视化对象”窗格创建和修改可视化对象。In Part 2, you'll learn how to use drag-and-drop and make full use of the Fields and Visualizations panes to create and modify visualizations.

创建新的可视化对象Create a new visualization

在本教程中,我们将深入探讨我们的零售分析数据集并创建几个关键的可视化对象。In this tutorial, we'll dig into our Retail Analysis dataset and create a few key visualizations.

先决条件Prerequisites

本教程使用零售分析示例 PBIX 文件This tutorial uses the Retail analysis sample PBIX file.

  1. 在 Power BI Desktop 菜单栏的左上部分,选择“文件” > “打开” From the upper left section of the Power BI Desktop menu bar, select File > Open

  2. 查找零售分析示例 PBIX 文件的副本Find your copy of the Retail Analysis sample PBIX file

  3. 在报表视图中打开零售分析示例 PBIX 文件报表视图屏幕截图图标Open the Retail Analysis sample PBIX file in report view Screenshot of the report view icon..

  4. 选择Select 黄色选项卡的屏幕截图。 ,以添加新报表页。to add a new page.

将可视化效果添加到报表Add visualizations to the report

通过从“字段”窗格中选择字段来创建可视化效果。Create a visualization by selecting a field from the Fields pane. 所创建的可视化效果类型取决于所选字段的类型。The type of visualization created will depend on the type of field selected. Power BI 使用数据类型确定使用哪种可视化效果来显示结果。Power BI uses the data type to determine which visualization to use to display the results. 可通过从可视化效果窗格中选择不同图标来更改所用的可视化效果。You can change the visualization used by selecting a different icon from the Visualizations pane. 请记住,并非所有可视化效果都能显示数据。Keep in mind that not all visualizations can display your data. 例如,使用漏斗图或折线图时,地理数据将无法正常显示。For example, geographic data will not display well using a funnel chart or line chart.

添加显示今年与去年相比的销售额的分区图Add an area chart that looks at this year's sales compared to last year

  1. 从“销售额”表中,选择“本年度销售额” > 和“去年销售额”。From the Sales table, select This Year Sales > Value and Last Year Sales. Power BI 将创建柱形图。Power BI creates a column chart. 此图表十分有趣,你可能想要深入了解。This chart is interesting, and you want to dig deeper. 每月销售额看上去如何?What do the sales look like by month?

    显示柱形图的屏幕截图

  2. 从“时间”表中,将“会计月”拖动到“轴”区域。From the Time table, drag FiscalMonth into the Axis area.
    显示将会计月作为轴的柱形图的屏幕截图Screenshot showing column chart with FiscalMonth as axis

  3. 可视化对象更改为一个区域图。Change the visualization to an area chart. 提供许多可视化类型可供选择 - 请参阅每种类型的描述、最佳做法提示和教程,获取类型选择相关帮助。There are many visualization types to choose from - see descriptions of each, tips for best practices, and tutorials for help with deciding which type to use. 在“可视化效果”窗格中,选择分区图图 “可视化效果”窗格中的分区图图标From the Visualizations pane, select the area chart icon Area chart icon from Visualizations pane.

  4. 选择“更多选项”(…),然后选择“排序” > “会计月”,对视觉对象排序 。Sort the visualization by selecting More actions (...) and choosing Sort by > FiscalMonth.

  5. 调整可视化对象的大小,方法是选择可视化对象,抓取其中一个边框圈并进行拖动。Resize the visualization by selecting the visualization, grabbing one of the outline circles and dragging. 使其宽度足以消除滚动条,同时足够小,从而使我们有足够的空间来添加其他可视化对象。Make it wide enough to eliminate the scrollbar and small enough to give us enough room to add another visualization.

    分区图视觉对象的屏幕截图

  6. 保存报表Save the report.

添加按位置查看销售额的地图可视化对象Add a map visualization that looks at sales by location

  1. 从“商店”表中,选择“区域”。From the Store table, select Territory. 将“总商店数”拖动至“大小”区域。Drag Total Stores into the Size area. Power BI 识别出 Territory 是一个位置,并创建地图可视化对象。Power BI recognizes that Territory is a location, and creates a map visualization.
    分区图Area chart

  2. 添加图例。Add a legend. 要按商店名称查看数据,请将“商店” > “连锁店”拖到图例区域 。To see the data by store name, drag Store > Chain into the Legend area.
    带有箭头(从字段列表中的链到图例桶中的链)的报表画布report canvas with arrow from Chain in fields list to Chain in Legend bucket

备注

与 Power BI 同事共享报表时,你和这位同事都应具有独立的 Power BI Pro 许可证,并且应将报表保存在 Premium 容量中。Sharing your report with a Power BI colleague requires that you both have individual Power BI Pro licenses or that the report is saved in Premium capacity. 请参阅共享报表See sharing reports.

后续步骤Next steps