可视化Visualizations

可视化效果让数据融入生活,并展现令人瞩目的出色可视化表示形式所独有的洞察力。Visualizations bring your data to life, and reveal insights that only compelling and amazing visual representations can. Power BI 引导式学习教程的本部分介绍如何开始使用可视化效果。This section of Power BI Guided Learning shows you how to get started using them.

你将了解操作方式...

Power BI 中的视觉对象简介Introduction to visuals in Power BI

欢迎来到 Power BI 引导学习课程的可视化效果部分。Welcome to the Visualizations section of the Guided Learning course for Power BI. 准备好体验 Power BI 提供的众多可视化效果的趣味十足的启发之旅。Get ready for a fun, interesting, and enlightening tour of the many, many visualizations Power BI has to offer. 这并还不是全部 - 我们将不断推出更多可视化效果!And this isn't all of them - there are more visualizations coming all the time!

当然,视觉对象是任何商业智能事业的最终结果...我们希望获取数据、以引人注目并可提供深刻见解的方式呈现这些数据,并 显示 重要内容。Power BI 提供各种引人注目的视觉对象(以及对其进行自定义的几乎无限制的方法),因此这一部分非常重要!Of course, visuals are the end-result of any business intelligence undertaking... we want to take data, present it in a compelling and insightful way, and show what stands out. And Power BI has all sorts of compelling visuals - and a nearly limitless way to customize them - so this is an important section!

这一部分看似有很多主题,但不必担心:每个主题都很短,并且如你所想,介绍了各种视觉对象,并且很容易理解吸收。It might seem like there are lots of topics in this section, but don't worry: each topic is short, filled with (you guessed it) visuals, and easy to absorb. 你很可能会发现自己在本部分中漫游,并想象如何在自己的数据中呈现这些视觉对象。You'll likely find yourself cruising through this section, and imagining how you'll make these visuals present your own data.

我们将从可视化的支柱(人人都熟悉的简单视觉对象)开始,并确保让你了解各种细节。We'll start with the mainstays of visualizations - the simple visuals we're all familiar with - and make sure you know the ins and outs. 然后我们会讲到更高级的(至少是更少见的)视觉对象,充实你的报表创建工具箱。Then we'll get more advanced, or at least a little less common, and fill up your report-creating toolbox.

祝你学习愉快 - 你可以在这里学到很多知识和技巧!Have fun - there's a lot to learn here!

Power BI 中的视觉对象简介Introduction to visuals in Power BI

实现数据可视化是 Power BI 的核心部分(像我们在本课程前面所定义那样,它是基本的构建基块),而创建视觉对象是发现并共享你的见解的最简方法。Visualizing data is one of the core parts of Power BI - a basic building block as we defined it earlier in this course - and creating visuals is the easiest way to find and share your insights.

Power BI 默认提供众多可视化效果,从简单的条形图到饼图再到地图,甚至瀑布图、漏斗图和仪表等更深奥的可视化效果。Power BI has a whole range of visualizations available by default, from simple bar charts to pie charts to maps, and even more esoteric offerings like waterfalls, funnels, gauges, and more. Power BI Desktop 还提供大量页面格式设置工具(如形状和图像),可帮助让报表变得生动。Power BI Desktop also offers extensive page formatting tools, such as shapes and images, that help bring your report to life.

创建和自定义简单的可视化效果Create and customize simple visualizations

在本文中,你将了解如何创建新的条形图、饼图和树状图,并自定义它们以适应你的报表。In this article you learn how to create new bar charts, pie charts, and treemaps, and customize them to suit your reports.

在 Power BI Desktop 中有两种不同的方式来创建新的可视化效果:There are two different ways to create a new visualization in Power BI Desktop:

  • 你可以从字段窗格中拖动字段名称,并将它们放在报表画布上。You can drag field names from the Fields pane, and drop them on the report canvas. 默认情况下,你的可视化效果显示为数据表。By default your visualization appears as a table of data.

  • 你也可以在可视化效果窗格中单击想要创建的可视化效果类型。You can also click the type of visualization you want to create in the Visualizations pane. 如果使用此方法,默认的视觉对象则是类似于你所选的视觉对象类型的空白占位符。With this method, the default visual is a blank placeholder that resembles the type of visual you selected.

在你创建了图形、映射或图表后,便可以开始将数据字段拖动到可视化效果窗格的下半部分以生成和组织你的视觉对象。Once you create your graph, map, or chart, you can begin dragging data fields onto the bottom portion of the Visualization pane to build and organize your visual. 可用字段将基于你所选择的可视化效果的类型而进行更改。The available fields will change based on the type of visualization that you selected. 当你拖放数据字段时,你的可视化效果将自动更新以反映相应的更改。As you drag and drop data fields, your visualization will automatically update to reflect changes.

可通过选中你的可视化效果,然后将句柄拖进或拖出来重设可视化效果的大小。还可以通过单击和拖动可视化效果将其移到画布上的任意位置。You can resize your visualization by selecting it and then dragging the handles in or out. You can also move your visualization anywhere on the canvas by clicking and then dragging it. 如果你想要在不同类型的可视化效果之间进行转换,请选择你想要更改的视觉对象,接着只需从可视化效果窗格中的图标选择其他的视觉对象即可。If you want to convert between different types of visualizations, select the visual you want to change and simply select a different visual from the icons in the Visualization pane. Power BI 尝试将所选的字段尽可能地转换为新的视觉对象类型。Power BI attempts to convert your selected fields to the new visual type as closely as possible.

当鼠标悬停在可视化效果的某些部分时,你将获得工具提示,其中包含有关该细分市场的详细信息,如标签和总值。As you hover over parts of your visualizations, you'll get a tooltip that contains details about that segment, such as labels and total value.

选择可视化效果窗格上的画笔图标,以对你的可视对象进行外观上的更改,例如背景对齐方式、标题文本和数据颜色。Select the paintbrush icon on the Visualizations pane to make cosmetic changes to your visual, such as background alignment, title text, and data colors.

对你的视觉对象进行外观上的更改的可用选项根据你所选的视觉对象类型而变化。The available options for cosmetic changes to your visual vary depending on the type of visual you have selected.

组合图表Combination charts

如果想要对两个具有不同比例的度量值(例如收入和单位)进行可视化,显示折线和具有不同轴刻度的条形图的组合图表将非常有用。When you want to visualize two measures that have very different scales, such as revenue and units, a combination chart that shows a line and a bar with different axis scales is very useful. 默认情况下,Power BI 支持许多不同类型的组合图表,包括常用的折线图堆积柱形图图表。Power BI supports many different types of combination charts by default, including the popular Line and Stacked Columns charts.

创建组合图表时,将为你提供共享轴(X- 轴)的字段,然后提供两个字段(这一情况下,是柱形图和折线图)的值。When you create a combination chart, you're presented with a field for Shared Axis (the X-axis), and then values for your two fields, in this case a column and a line. 两个 Y 轴图例显示在可视化效果的两侧。The two Y-axis legends appear on either side of the visualization.

你还可以通过将一个类别拖到“可视化效果”窗格中的“列序列”字段,按类别拆分每一列。You can also split each column by category, by dragging a category into the Column Series field in the Visualizations pane. 进行这一操作的时候,条形图的每个柱均基于每一类别内的值,按比例着色。When you do so, each bar is proportionately colored based on the values within each category.

组合图表是在单个可视化效果中,对多个具有不同比例的度量值进行可视化的有效方法。Combination charts are an effective way to visualize multiple measures that have very different scales in a single visualization.

切片器Slicers

切片器是一种功能强大的可视化效果,尤其是它可作为繁重报表的一部分。Slicers are one of the most powerful types of visualizations, particularly as part of a busy report. 切片器Power BI Desktop 中的一种画布内视觉筛选器,查看报表的任何用户都可使用它按年份或地理位置等特定值来分割数据。A slicer is an on-canvas visual filter in Power BI Desktop that lets anyone looking at a report segment the data by a particular value, such as by year or by geographical location.

若要向报表添加切片器,请从可视化效果窗格中选择切片器To add a slicer to your report, select Slicer from the Visualizations pane.

拖动想要用作切片依据的字段,并将其放置到切片器占位符上。Drag the field by which you want to slice and drop it top of the slicer placeholder. 可视化效果将变为带复选框的元素列表。The visualization turns into a list of elements with checkboxes. 这些元素就是筛选器 - 选择元素旁的复选框进行分割,即可选择对同一报表页上的所有其他可视化效果进行筛选或 切片These elements are your filters - select the box next to one to segment, and all other visualizations on the same report page are filtered, or sliced, by your selection.

可将切片器设置为几种不同格式。There are a few different options available to format your slicer. 你可以将其设置为同时接受多个输入,或切换到单选模式以便每次使用一个输入。You can set it to accept multiple inputs at once, or toggle Single Select mode to use one at a time. 还可向切片器元素添加全选选项,此选项在列表很长时会有帮助。You can also add a Select All option to your slicer elements, which is helpful when you have a particularly long list. 将切片器方向从默认的垂直改为水平,更改后它将变为选项栏而非清单。Change the orientation of your slicer from the vertical default to horizontal, and it becomes a selection bar rather than a checklist.

地图可视化效果Map visualizations

Power BI 具有两种不同类型的地图可视化效果:在地理点上方添加气泡的气泡图,以及实际展示你想要进行可视化的区域的轮廓的形状图。Power BI has two different types of map visualizations: a bubble map that places a bubble over a geographic point, and a shape map that actually shows the outline of area you want to visualize.

备注

处理国家或地区时,请使用三字母缩写,以确保地理编码可以在地图可视化效果中正常运行。When working with countries or regions, use the three-letter abbreviation to ensure that geocoding works properly in map visualizations. 不要使用两字母缩写,因为这样可能无法正确识别某些国家或地区。Do not use two-letter abbreviations, as some countries or regions may not be properly recognized. 如果只有两字母缩写,请参阅这篇外部博文,了解将两字母国家/地区缩写与三字母国家/地区缩写相关联的具体步骤。If you only have two-letter abbreviations, check out this external blog post for steps on how to associate your two-letter country/region abbreviations with three-letter country/region abbreviations.

创建气泡图Create bubble maps

若要创建气泡图,请在可视化效果窗格上选择地图选项。To create a bubble map, select the Map option in the Visualization pane. 必须将一个值添加到可视化效果选项中的位置存储桶,以使用地图视觉对象。You must add a value to the Location bucket in the Visualizations options to use a map visual.

Power BI 能灵活接受各种位置值类型(上到较为常规的详细信息,例如城市名称或机场代码,下到非常具体的纬度和经度数据)。Power BI is flexible about what type of location value it accepts, from more general details like city name or airport code, down to very specific latitude and longitude data. 向“大小”Bucket 添加字段,以相应地更改每个地图位置的气泡大小。Add a field to the Size bucket to change the size of the bubble accordingly for each map location.

创建形状图Create shape maps

若要创建形状图,请在“可视化效果”窗格中选择着色地图选项。To create a shape map, select the Filled Map option in the Visualization pane. 就像气泡图一样,必须将某种类型的值添加到“位置”存储桶,以使用此视觉对象。As with bubble maps, you must add some kind of value to the Location bucket to use this visual. 向“大小”Bucket 添加字段,以相应地更改填充颜色的浓度。Add a field to the Size bucket to change the intensity of the fill color accordingly.

视觉对象左上角中的警告图标指示该地图需要更多的位置数据以准确地绘制值。A warning icon in the top left corner of your visual indicates that the map needs more location data to accurately plot values. 位置字段中的数据不明确时,这是一个特别常见的问题,例如,使用类似华盛顿这样可以表示一个州或一个区的区域名称。This is a particularly common problem when the data in your location field is ambiguous, such as using an area name like Washington that could indicate a state or a district. 解决此问题的一种方法是重命名列,使其更具体,例如州。One way to resolve this problem is to rename your column to be more specific, such as State. 解决这一问题的另一个方法是通过选择“建模”选项卡中的数据类别,手动重置数据类别。从这里,你可以向数据分配一个类别,如“州”或“城市”。Another way to resolve it is to manually reset the data category by selecting Data Category in the Modeling tab. From there you can assign a category to your data such as "State" or "City".

矩阵和表Matrixes and tables

除了支持大量图表外,Power BI Desktop 还支持许多表格式可视化效果。In addition to an abundance of charts, Power BI Desktop also supports more tabular visualizations. 在实际操作中,当你获取分类字段或文本字段并将其拖动到报表画布时,默认情况下你会获得一张结果表。In fact, when you grab a categorical field or text field and drag it onto the report canvas, you get a table of results by default. 你可以向上或向下滚动浏览表,初始情况下它会按字母顺序排序。You can scroll up and down through the table, and initially it will be sorted alphabetically.

如果表中有数字信息,例如收入,总金额将会显示在底部。If you have numerical information in a table, such as revenue, a total sum will appear at the bottom. 你可以通过单击其标题来切换升序或降序的顺序,以按列进行手动排序。You can manually sort by each column by clicking on its header to toggle ascending or descending order. 如果列的宽度不足以显示其全部内容,单击并拖动侧向的标题可增大列宽。If a column is not wide enough to display all of its contents, click and drag the header sideways to expand it.

可视化效果窗格中值存储桶中的字段顺序决定了它们在表内的显示顺序。The order of the fields in the Values bucket in the Visualizations pane determines the order in which they appear in your table.

矩阵与表类似,但它在行和列上具有不同的类别标题。A matrix is similar to a table, but it has different category headers on the columns and rows. 与表一样,数字信息会自动在矩阵的底部和右侧自动汇总。As with tables, numerical information will be automatically totaled along the bottom and right side of the matrix.

有许多修饰选项可用于矩阵,例如自动调整列宽大小、切换行和列总计数、设置颜色以及更多操作。There are many cosmetic options available for matrixes, such as auto-sizing columns, toggling row and column totals, setting colors, and more. 创建矩阵时,请确保分类数据(非数字数据)位于矩阵左侧,数字文件位于右侧,以确保出现水平滚动条,并且滚动条可正常工作。When creating a matrix, make sure your categorical data (the non-number data) is on the left of the matrix, and the numeric files on the right to ensure the horizontal scroll bar appears, and to make sure that scrolling behavior works properly.

散点图Scatter charts

如果想要比较两个不同的度量值,例如单位销售额和收入,常见的可视化效果就是使用散点图。If you want to compare two different measures, such as unit sales verses revenue, a common visualization to use is a scatter chart.

若要创建空白图表,请在可视化效果窗格中选择散点图To create a blank chart, select Scatter chart from the Visualizations pane. 字段窗格中将你想要进行比较的两个字段拖放到 X 轴和 Y 轴选项存储桶。Drag and drop the two fields you want to compare from the Fields pane to the X Axis and Y Axis options buckets. 到这里,你的散点图可能仅仅在视觉对象中心拥有小小的气泡 - 你需要将度量值添加到详细信息存储桶,以指示希望如何分割你的数据。At this point, your scatter chart probably just has a small bubble in the center of the visual - you need to add a measure to the Details bucket to indicate how you would like to segment your data. 例如,如果你正在比较物料销售额和收入,建议按类别、制造商或销售月份拆分数据。For example, if are comparing item sales and revenue, perhaps you want to split the data by category, or manufacturer, or month of sale.

将其他字段添加到图例存储桶,以便根据字段的值对气泡进行颜色编码。Adding an additional field to the Legend bucket color-codes your bubbles according to the field's value. 你还可以向大小存储桶中添加字段,以按照该值更改气泡大小。You can also add a field to the Size bucket to alter the bubble size according to that value.

散点图也有许多视觉对象格式设置选项,例如,打开每个彩色气泡的轮廓线和切换单个标签。Scatter charts have many visual formatting options as well, such as turning on an outline for each colored bubble and toggling individual labels. 你也可以为其他图表类型更改数据颜色。You can change the data colors for other chart types, as well.

通过将基于时间的字段添加到播放轴存储桶,你可以创建气泡图随时间推移发生变化的动画。You can create an animation of your bubble chart's changes over time by adding a time-based field to the Play Axis bucket. 在动画播放期间,单击气泡可查看其路径轨迹。Click on a bubble during an animation to see a trace of its path.

备注

请注意,如果在散点图中只看到一个气泡,是因为 Power BI 正在聚合数据。这是默认行为。Remember, if you only see one bubble in your scatter chart, it's because Power BI is aggregating your data, which is the default behavior. 可视化效果窗格中,向详细信息存储桶添加类别以获取更多气泡。Add a category to the Details bucket, in the Visualizations pane, to get more bubbles.

瀑布图和漏斗图Waterfall and funnel charts

瀑布图和漏斗图是 Power BI 中包含的两种更加有趣(可能不常见)的标准可视化效果。Waterfall and funnel charts are two of the more interesting (and perhaps uncommon) standard visualizations that are included in Power BI. 若要创建任一类型的空白图表,请在可视化效果窗格中选择其图标。To create a blank chart of either type, select its icon from the Visualizations pane.

瀑布图通常用于显示特定值随时间的更改。Waterfall charts are typically used to show changes in a particular value over time.

瀑布图仅有两个存储桶选项:类别和 Y 轴。Waterfalls only have two bucket options: Category and Y Axis. 将基于时间的字段(例如年份)拖动到类别存储桶,并将你想跟踪的值拖动到 Y 轴存储桶。Drag a time-based field such as year to the Category bucket, and the value you want to track to the Y Axis bucket. 默认情况下,值有所增加的时间段会显示为绿色,而值有所减少的时间段会显示为红色。Time periods where there was an increase in value are displayed in green by default, while periods with a decrease in value are displayed in red.

漏斗图通常用于显示随特定过程的更改,例如销售管道或网站保留工作。Funnel charts are typically used to show changes over a particular process, such as a sales pipeline or website retention efforts.

瀑布图漏斗图两者都可以进行分隔和自定义可视化效果。Both Waterfall and Funnel charts can be sliced and visually customized.

仪表和单数字卡片Gauges and single-number cards

通常情况下,可视化效果用于比较两个或多个不同值。Generally, visualizations are used to compare two or more different values. 但是,有时生成报表时,你可能希望仅跟踪一个关键绩效指标 (KPI) 或度量值随着时间推移的变化。However, sometimes when building reports you may want to track a just single Key Performance Indicator (KPI) or metric over time. 若要在 Power BI Desktop 中执行此操作,方法是使用仪表单数字卡片视觉对象。The way to do this in Power BI Desktop is with a Gauge or single number card visual. 若要创建任一类型的空白图表,请在可视化效果窗格中选择其图标。To create a blank chart of either type, select its icon from the Visualizations pane.

当要构建仪表板,并且想要显示特定目标的进展时,仪表将特别有用。Gauges are particularly useful when you are building dashboards and want to show progress towards a particular target. 若要创建仪表,在可视化效果窗格中选择其图标,然后将要跟踪的字段拖动到值存储桶。To create a gauge, select its icon from the Visualizations pane, and drag the field you want to track into the Value bucket.

默认情况下,仪表将以 50%,或值的双倍显示,并且有两种方法来调整此设置。Gauges appear by default at 50%, or double the Value, and there are two ways to adjust this setting. 若要以动态方式设置值,请将字段拖动到最小、最大和目标值存储桶。To dynamically set the values, drag fields to the Minimum, Maximum, and Target Value buckets. 或者,使用视觉对象格式化选项来手动自定义你的仪表范围。Alternatively, use the visual formatting options to manually customize the range of your gauge.

卡片可视化效果只是显示字段的数字表示形式。Card visualizations simply show a numeric representation of a field. 默认情况下,卡片视觉对象使用显示单位来使数字简短,例如显示“50 亿美元”而不是“5,000,000,000 美元”。By default card visuals use display units to keep the number short, for example displaying "$5bn" instead of "$5,000,000,000". 使用视觉对象格式化选项来更改使用的单位或彻底禁用它。Use the visual formatting options to change the unit being used, or disable it completely.

一个有趣卡片应用程序是让其显示已与文本串联的自定义度量值。One interesting application of cards is to have them display a custom measure that you've concatenated with text. 若要使用较早的示例,借助自定义度量值,你的卡片可以包括高级 DAX 函数并显示类似“本年总税收:50 亿美元”或“本年度单位销售进度:”的内容,然后添加表示进度的数字。To use the earlier example, with a custom measure your card could include advanced DAX functions and display something like, "Total revenue this year: $5bn" or "Progress on unit sales this year:" and then add the number that represents the progress.

修改图表和视觉对象中的颜色Modify colors in charts and visuals

很多时候,你可能想要修改在图表或视觉对象中使用的颜色。There are many times when you might want to modify the colors used in charts or visuals. Power BI 为你提供了有关颜色显示方式的大量控件。Power BI gives you lots of control over how colors are displayed. 若要开始,选择视觉对象,然后在可视化效果窗格中,单击画笔图标。To get started, select a visual then in the Visualizations pane, click the paintbrush icon.

有很多用于更改视觉对象的颜色或格式设置的选项。There are many options for changing the colors or formatting of the visual. 你可以通过选择默认颜色旁边的颜色选取器,然后选择你所选择的颜色,来更改视觉对象的所有条形的颜色。You can change the color of all bars of a visual by selecting the color picker beside Default color, then selecting your color of choice.

还可以通过将全部显示滑块切换到“on”来更改每个条形(或其他元素,取决于你选择的视觉对象类型)的颜色。You can also change the color of each bar (or other element, depending on the type of visual you selected) by toggling the Show all slider to on. 执行操作时,每个元素都会显示颜色选择器。When you do, a color selector appears for each element.

还可以基于某个值或度量值更改颜色。You can also change the color based on a value, or measure. 若要执行该操作,请将字段拖动到可视化效果窗格(请注意此窗格在字段框分区而不是在画笔分区中可用)中的颜色饱和度存储桶中。To do so, drag a field into the Color saturation bucket in the Visualizations pane (note that this is available in the field well section, not the paintbrush section).

此外,你可以更改填充数据元素颜色时所用的色阶和颜色。In addition, you can change the scale and the colors that are used when filling data element colors. 你还可以通过将散射滑块切换到“on”来选择散射规模,这允许在三种颜色之间进行扩展。You can also select a diverging scale by toggling the Diverging slider to on, which lets the color scale between three colors. 并且你还可以设置显示在图表上的 最小中间最大 值。And you can also set Minimum, Center, and Maxumum values displayed on your chart.

你还可以使用这些值创建规则,例如,将大于零的值设为一种颜色,小于零的值设为另一种颜色。You can also use those values to create rules, for example, to set values above zero a certain color, and values below to another color.

使用颜色的另一便捷工具是设置恒线(有时亦称为“参考线”)。Another handy tool for using colors is setting a constant line, also sometimes referred to as a reference line. 可以设置恒线的值和颜色,甚至可以让参考线包含标签。You can set the value of the constant line, set its color, and even have the reference line contain a label. 若要创建恒线(以及其他相关线),请选择“分析”窗格(形似放大镜),再展开“参考线”部分。To create a constant line (and other interesting lines), select the Analytics pane (looks like a magnifying glass) then expand the Reference Line section.

可以为视觉对象创建其他许多线(也是在“分析”窗格中执行操作),如“最小值线”、“最大值线”、“平均值线”、“中值线”和“百分位数线”。There are many other lines you can create for a visual, also found in the Analytics pane, such as Min, Max, Average, Median, and Percentile lines.

最后,你可以创建单个视觉对象的边框,并且与其他控件一样,你还可以指定边框的颜色。Lastly, you can create a border around an individual visualization, and like other controls, you can specify the color of that border as well.

形状、文本框和图像Shapes, text boxes, and images

除了绑定数据的视觉对象外,你还可以添加静态元素(如文本框、图像和形状)来改进报表的视觉设计。Along with data-bound visuals, you can also add static elements such as text boxes, images, and shapes to improve the visual design of your reports. 若要添加视觉元素,请从开始选项卡选择文本框图像形状To add a visual element, select Text Box, Image, or Shapes from the Home tab.

文本框是随可视化效果显示大标题、题注或短段落信息的理想方法。Text boxes are an ideal way to display large titles, captions, or short paragraphs of information along with your visualizations. 可通过编写 URL,或通过在文本框选项栏上突出显示固定短语并选择链接符号,使文本框包括链接。Text boxes can include links, either through a written URL or by highlighting an anchor phrase and selecting the link symbol on the text box options bar. 你可以在文本框中包括 URL,Power BI 将自动检测链接并使其实时更新。You can include URLs in text boxes, and Power BI automatically detects the link, and makes it live.

选择图像将打开文件浏览器,你可以在其中从计算机或其他联网源选择图像。Selecting Image will open a file browser where you can select the image from your computer or other networked source. 默认情况下,在报表中重新调整图像大小将维持其纵横比,但可在视觉对象格式选项中禁用此功能。By default, resizing an image in your report will maintain its aspect ratio, but this can be disabled in the visual formatting options.

形状有五种不同的形式选项,包括矩形和箭头。Shapes have five different options for form, including rectangles and arrows. 形状可以不透明,也可以透明并带有彩色边框。Shapes can be opaque, or transparent with a colored border. (后者对于在可视化效果组周围创建边框很有用。)(The latter is useful for creating borders around groups of visualizations.)

页面布局和格式设置Page layout and formatting

Power BI Desktop 使你能够控制报表页面的布局和格式,如大小和方向。Power BI Desktop gives you the ability to control the layout and formatting of your report pages, such as size and orientation.

使用“开始”选项卡中的页面视图菜单,更改报表页面的缩放方式。Use the Page View menu from the Home tab to change the way your report pages scale. 可用选项包括适应页面(默认值)、适应宽度实际大小The available options include Fit To Page (default), Fit To Width, and Actual Size.

还可以自行更改页面大小。You can also change the pages size itself. 默认情况下,报表页比例为 16:9。By default, report pages are 16:9. 若要更改页面大小,请确保没有选择任何视觉对象,然后在“可视化效果”窗格中,选择画笔图标,然后选择页面大小以展开该部分。To change the page size, make sure no visuals are selected, then select the paintbrush icon in the Visualizations pane, then select Page Size to expand that section.

页大小的选项包括 4x3(更多方形纵横比)和动态(页面将拉伸以填充可用空间)。Options for page size include 4x3 (more square aspect ratio), and Dynamic (the page will stretch to fill the available space). 报表还有标准的信纸大小。There's a standard letter size for reports as well. 请记住,在更改页面大小之后,你可能需要调整视觉元素,确保它们完全显示在画布上。Keep in mind that you may need to resize your visuals after changing the page size to ensure that they're completely on the canvas.

你还可以指定自定义页面大小,设置大小(英寸或像素)和更改整个报表的背景色。You can also specify a custom page size, setting the size by inches or pixels, and change the background color of the entire report.

另一种方法是选择 Cortana,用于调整报表的大小,因此它可以用作使用 Cortana 的搜索结果。Another option is to select Cortana, which sizes the report so that it can be used as a result for searches using Cortana.

对可视化效果间的交互作用进行分组Group interactions among visualizations

当同一报表页上具有多个可视化效果时,通过单击或使用切片器选择特定片段将影响该页上的所有视觉对象。When you have multiple visualizations on the same report page, selecting a particular segment by clicking or using a slicer will affect all the visuals on that page. 但是,在某些情况下,你可能只想切分特定的视觉对象。In some cases, though, you may want to slice only specific visuals. 使用散点图等元素时尤其如此,在这些元素中将数据限制为特定片段将删除重要含义。This is particularly true when using elements such as scatter plots, where limiting the data to a specific segment will remove crucial meaning. 幸运的是,Power BI Desktop 让你能够控制视觉对象之间交互作用的流向。Fortunately, Power BI Desktop lets you control how interactions flow between visuals.

若要更改可视化效果之间的交互作用,请从开始功能区的“视觉对象”部分选择编辑,以切换到编辑模式To change the interaction between your visualizations, select Edit from the Visuals section of the Home ribbon to toggle Edit Mode on.

备注

自录制视频后,Power BI Desktop 中的“编辑交互作用”图标即已改变。The Edit Interactions icon in Power BI Desktop has changed since the video was recorded.

现在,当你选择报表画布上的视觉对象时,它将影响的每个其他视觉对象右上角将显示小型不透明 筛选器 图标。Now when you select a visual on your report canvas, you'll see a small opaque filter icon in the top right-hand corner of every other visual it will affect. 若要从交互作用中排除视觉对象,请单击右上角 筛选器 图标旁边的 符号。To exclude a visual from the interaction, click the None symbol in the upper right corner, near the filter icon.

在某些情况下,你可以调整视觉对象之间出现的筛选器交互作用的类型。In some instances you can adjust the type of filter interaction that happens between visuals. 切换到编辑模式后,选择你用于筛选的视觉对象。With Edit Mode toggled on, select the visual you use to filter. 如果你可以更改另一个视觉对象上的交互作用类型,则右上角筛选器图标旁边将出现 饼图 图标。If you can change the type of interaction on another visual, a pie chart icon will appear next to the filter icon in the top right-hand corner.

单击 饼图 图标以突出显示分段数据。Click the pie chart icon to highlight the segmented data. 否则,数据将被筛选。Otherwise, the data will be filtered. 像之前一样,你可以单击 图标删除所有交互作用。As before, you can click the None icon to remove all interaction.

在互相交互的视觉对象周围绘制透明形状是一个有用的设计技巧,这样就可以明确告知用户它们具有交互关系。A useful design tip is to draw a transparent shape around visuals that interact with each other, so it's clear to the user that they have an interactive relationship.

复制报表页Duplicate a report page

报表的各个页可以使用多个可视化效果,非常复杂。可视化效果以特定方式进行交互,并且有精确的格式设置。Individual pages of a report can be quite complex, with multiple visualizations that interact in specific ways and have precise formatting. 有时候在生成报表时,你可能希望对两个不同的页面主题使用相同的可视化效果和布局。Occasionally when building a report, you may want to use the same visuals and layouts for two different page topics. 例如,如果已经生成了针对毛收入的报表页,你可能希望生成几乎完全相同的针对净收入的页面。For example, if you've just put together a report page on gross revenue, you may want an almost identical page on net revenue.

重新创建所有工作将会非常麻烦,但是借助 Power BI Desktop,你仅需复制报表页即可。Recreating all of your work would be difficult, but with Power BI Desktop you can just duplicate a report page.

右键单击要复制的选项卡,然后选择复制页面Right-click on the tab you want to copy, and select Duplicate Page.

然后就可以适当重命名新页面选项卡、更新文本标题(如果有标题),然后使用要跟踪的新字段更新你的可视化效果。You can then rename the new page tab as appropriate, update the text title if you have one, and then update your visuals with the new field you want to track.

显示不包含数据的类别Show categories with no data

默认情况下,列标题仅显示在包含数据的报表中。By default, column headings are only displayed in your reports if they contain data. 例如,如果你按国家/地区显示收入,并且在挪威没有销售额,则挪威不会显示在可视化效果中的任何位置。For example, if you were displaying revenue by country and had no sales in Norway, then Norway would not appear anywhere in your visualization.

若要显示空的类别,请单击可视化效果窗格中你想要更改的字段中的下拉箭头,然后选择显示无数据项To display empty categories, click on the down-arrow in the field you want to change in the Visualizations pane, and select Show items with no data.

空值视觉对象中将显示所有空列。Any empty columns now appear in your visual with blank values.

可视化效果窗格中的任意字段选择显示无数据项后,它将应用到可视化效果窗格中显示的所有字段。Once you select Show items with no data for any field in the Visualizations pane, it applies to all fields displayed in the Visualizations pane. 因此,如果你添加另一字段,无数据的任何项也会显示出来,而无需重新访问下拉菜单。So if you add another field, any items that have no data will also be shown, without having to revisit the drop-down menu.

汇总和分类选项Summarization and category options

Power BI 的属性可以分配到模型的各个字段,这有助于你以更清晰的显示方式报表、可视化和表示数据。Power BI has properties that you can assign for fields in your model, which can help report and visualize and present data in ways that provide more clarity. 例如,有时你想要计算数字列表的平均值,Power BI 就会自动对该列表求和。For example, sometimes you want to average a list of numbers, but Power BI automatically sums the list. 你可以使用 Power BI 调整这些数字列表的汇总方式。With Power BI, you can adjust how those lists of numbers are summarized.

数值汇总控制Numeric control over summarization

我们来举例说明如何控制 Power BI 汇总数字数据字段的方式。Let's take an example, and demonstrate how to control the way Power BI summarizes numeric data fields.

在报表画布上选择视觉对象,然后选择字段窗格中的某个字段。Select a visual on your report canvas, and then select a field in the Fields pane. 此时功能区将出现建模选项卡,并显示用于设置数据和数据属性格式的选项。The Modeling tab appears in the ribbon and displays options for formatting data, and data properties.

你可以通过选择货币符号下拉列表选择当前使用的货币符号类型,如下图所示。You can select the type of currency symbol used, by selecting the currency symbol drop down, which is shown in the following image.

有许多不同选项可供设置字段格式。There are many different options for formatting fields. 例如,可以将格式从货币改为百分比。For example, you can change the format from currency to percentage.

你也可以更改 Powwer BI 的数据汇总方式。You can change how Powwer BI summarizes the data, too. 选择默认汇总图标来更改汇总字段的方式,包括显示总和、计数或平均值。Select the Default Summarization icon to change how a field is summarized, including displaying a sum, a count, or an average.

管理和澄清位置数据Manage and clarify your location data

在地图上绘制位置时,可以进行类似更改。You can make similar changes when plotting locations on a map. 选择你的地图,然后选择字段窗格中的字段,将它用于位置值。Select your map, and then select the field in the Fields pane that you use for the Location value. 建模选项卡上,选择数据类别,然后从下拉菜单中选择表示你的位置数据的类别。On the Modeling tab, select Data Category and then choose the category that represents your location data from the drop-down menu. 例如,选择州、国家/地区或城市。For example, select state, county, or city.

Z 顺序Z-order

当报表上存在大量元素时,Power BI 使你能够管理它们彼此重叠的方式。When you have lots of elements on a report, Power BI lets you manage how they overlap with each other. 项目的分层方式,或者在其他项目上面的排列方式,常常被称为 Z 顺序。How items are layered, or arranged on top of one another, is often referred to as the z-order.

若要管理报表中的元素的 Z 顺序,请选择某个元素,并使用功能区的开始选项卡上的排列按钮更改其 Z 顺序。To manage the z-order of elements in a report, select an element, and use the Arrange button on the Home tab of the ribbon to change its z-order.

通过使用排列按钮菜单中的选项,你可以以你想要的方式获取报表中的元素顺序。By using the options in the Arrange button menu, you can get the ordering of elements on you report just the way you want it. 你可以将视觉对象向前或向后移动一层,或者将其直接发送至顺序的前端和后端。You can move a visual one layer forward or backward, or send it all the way to the front of the back of the order.

当使用形状作为修饰性背景或边框或者突出显示单个图表或图形的特定部分时,使用“排列”按钮尤其有用。Using the Arrange button is particularly useful when using shapes as decorative backgrounds or borders, or to highlight particular sections of an individual chart or graph. 你还可以使用它们来创建背景,比如下面用于报表标题背景的浅蓝色矩形。You can also use them to create a background, such as the following light-blue rectangle being used for a report title background.

视觉对象层次结构和向下钻取Visual hierarchies and drill-down

当你将 日期 字段添加到 字段存储桶的视觉对象中时,Power BI 会自动添加时间层次结构,其中包括 季度When you add a date field to a visual in the Axis field bucket, Power BI automatically adds a time hierarchy that includes Year, Quarter, Month and Day. 通过执行此操作,让用户向下钻取这些不同的时间级别,Power BI 可使你的视觉对象与查看你报表的用户进行基于时间的交互。By doing this, Power BI allows your visuals to have time-based interaction with those viewing your reports, by letting users drill-down through those different time levels.

利用就地层次结构,你可以开始向下钻取这些不同的时间层次结构。With a hierarchy in place, you can begin drilling down through the time hierarchy. 例如,单击某一年将向下钻取到层次结构中下一层次,在这种情况中, 季度 将会随后显示在视觉对象中。For example, clicking a year in the chart drills down to the next level in the hierarchy, in this case Quarters, which are then displayed in the visual.

在自动创建的层次结构中,你还可以管理共享的报表允许用户向下钻取到的具体级别。In that automatically created hierarchy, you can also manage to which level your shared report allows people to drill. 若要进行此操作,在可视化窗格中,只需单击你想要删除的层次结构旁边的 X 即可。To do this, in the Visualizations pane, simply click the X beside the hierarchy that you want to remove. 已删除的级别将从报表中删除,向下钻取将不再显示该级别。The deleted level is removed from the report, and drilling no longer displays that level.

如果你需要先获取该级别的层次结构,只需删除 日期 字段,并再次从 字段 窗格中添加,就会自动再次生成层次结构。If you need to get that level of the hierarchy back, just remove the date field, and then add it again from the Fields pane, and the hierarchy is once again created for you automatically.

可能有时你并不想将层次结构用于视觉对象。There may be times when you don't want the hierarchy to be used for a visual. 为此,你可以通过选择 日期 字段(前提是你已将其添加到视觉对象)旁的向下箭头按钮来控制该操作,然后选择 日期 而不是 日期层次结构You can control that by selecting the down-arrow button beside the Date field (once you've added it to a visual), and select Date rather than Date Hierarchy. 这将提示 Power BI 在视觉对象中显示原始日期值。That prompts Power BI to show the raw date values in the visual.

你也可以同时展开当前可见的所有数据元素,而不用选择单个季度或单一年份。You can also expand all data elements currently visible at once, rather than selecting a single quarter, or a single year. 若要执行该操作,请选择视觉对象左上角的 钻取全部 图标。这是一个双向下箭头图标。To do that, select the Drill all icon in the top left of the visual, which is a double-down arrow icon.

Power BI Desktop 中的 R 集成R integration in Power BI Desktop

使用 Power BI Desktop,你可以执行解析和统计分析并通过集成 R 来创建引人注目的视觉对象。你可以在 Power BI Desktop 报表内托管这些 R 可视化效果。With Power BI Desktop, you can perform analytical and statistical analysis and create compelling visuals by integrating with R. You can host those R visualizations within the Power BI Desktop report.

你在可视化效果窗格中选择 R 视觉对象图标时,Power BI 将在画布上创建一个占位符来承载你的 R 视觉对象,然后直接在该画布上提供一个 R 脚本编辑器供你使用。When you select the R visual icon from the Visualizations pane, Power BI creates a placeholder on the canvas to host your R visual, and then presents an R script editor for you to use right on the canvas. 在你将字段添加到 R 视觉对象时,Power BI Desktop 会将它们添加到 R 脚本编辑器窗格。As you add fields to the R visual, Power BI Desktop adds them to the R script editor pane.

在 R 脚本编辑器中 Power BI 所生成内容的下方,你可以开始创建用于生成视觉对象的 R 脚本。Below what Power BI generates in the R script editor, you can begin creating your R script to generate the visual. 脚本创建完成后,请选择运行,然后将发生以下情况:Once your script is complete, select Run and the following occurs:

  1. 添加到视觉对象的数据(从字段窗格)将从 Power BI Desktop 发送到 R 的本地安装The data added to the visual (from the Fields pane) is sent from Power BI Desktop to the local installation of R
  2. 在 Power BI Desktop R 脚本编辑器中创建的脚本将在 R 的本地安装上运行The script created in the Power BI Desktop R script editor is run on that local installation of R
  3. 然后 Power BI Desktop 从 R 安装反过来获取一个视觉对象,并将其显示在画布上Then Power BI Desktop gets a visual back from the R installation, and displays it on the canvas

这一切发生得相当快,结果将显示在画布上的 R 视觉对象可视化效果中。It all happens quite quickly, and the result appears in the R visual visualization on the canvas.

你可以通过调整 R 脚本并再次选择运行来更改 R 视觉对象。You can change the R visual by adjusting the R script, and then selecting Run again. 在下图中,我们将视觉对象更改为显示圆圈而不是正方形。In the following image, we changed the visual to display circles instead of squares.

R 视觉对象跟 Power BI Desktop 中的任何其他视觉对象一样,因此你可以在画布上与其进行交互并建立与其他视觉对象的连接。And since the R visual is just like any other visual in Power BI Desktop, you can interact with it and make connections with other visuals on the canvas as well. 当你通过筛选或突出显示在画布上与其他视觉对象进行交互时,R 视觉对象将像其他任何 Power BI 视觉对象一样自动作出反应,而无需调整 R 脚本。When you interact with other visuals on the canvas, through filtering or highlighting, the R visual automatically reacts just like any other Power BI visual, without needing to adjust the R script.

在 Power BI Desktop 中直接使用是利用 R 的强大功能的一种绝佳方法。It's a great way to use the power of R, right in Power BI Desktop.

后续步骤Next steps

祝贺你!Congratulations! 你已经完成了 Power BI 引导学习 课程的可视化部分。You've completed this Visualizations section of the Guided Learning course for Power BI. 现在,你可以认为自己已精通 Power BI 中提供的众多可视化效果,并了解如何对其进行使用、修改和自定义。You can consider yourself well-versed in the many visualizations offered in Power BI, and also knowledgeable about how to use, modify, and customize them. 好消息:可视化效果在 Power BI Desktop 和 Power BI 服务中本质相同,因此你所学知识适用于这二者。And good news: visualizations are essentially the same in Power BI Desktop and the Power BI service, so what you learned applies to both.

现在你可以开始了解云并享受 Power BI 服务了,在其中你可以浏览数据You're now ready to head to the cloud and get immersed in the Power BI service, where you can Explore Data. 如你所知,工作流如下所示:As you know, the flow of work looks something like the following:

  • 将数据导入 Power BI Desktop,然后创建报表。Bring data into Power BI Desktop, and create a report.
  • 发布到 Power BI 服务,你可在该服务中创建新的可视化效果和构建仪表板Publish to the Power BI service, where you create new visualizations and build dashboards
  • 与他人(尤其是差旅人员)共享你的仪表板Share your dashboards with others, especially people who are on the go
  • Power BI Mobile 应用中查看共享仪表板和报表并与其交互View and interact with shared dashboards and reports in Power BI Mobile apps

无论你创建报表还是仅查看报表并与其交互,现在你已了解如何创建所有这些精美的视觉对象,以及如何将其连接到数据。Whether you create reports or just view and interact with them, you now know how all those cool visuals are created, and how they connected to the data. 接下来,我们将在操作中查看这些视觉对象和报表。Next we get to see those visuals and reports in action.

下一部分见!See you in the next section!

恭喜!

干得不错。Nice work. 现已完成引导式学习教程的“可视化效果”部分,接下来可以学习下一篇教程 - 探索数据You've completed the Visualizations section of Guided Learning, and you're ready for the next tutorial - Exploring data.

你已了解操作方式...

下一个教程

研究数据Exploring data

作者

  • Davidiseminger
  • olprod
  • Alisha-Acharya