Power Bi 简明教程
Power BI - Visualization Options
在本教程中,您将了解 Power BI 中的各种可视化选项。
In this chapter, you will learn about the various visualization options in Power BI.
Creating Simple Visualizations
可视化用于有效显示您的数据,是任何商业智能工具的基础组成部分。Power BI 包含各种默认数据可视化组件,其中包括从简单的条形图到饼图再到地图,还包括瀑布图、漏斗图、仪表以及许多其他组件等复杂模型。
Visualizations are used to effectively present your data and are the basic building blocks of any Business Intelligence tool. Power BI contains various default data visualization components that include simple bar charts to pie charts to maps, and also complex models such as waterfalls, funnels, gauges, and many other components.

在 Power BI 中,您可以通过两种方式创建可视化。首先是通过从右侧窗格添加到报告画布。默认情况下,它是 Power BI 中选中的表格类型的可视化。另一种方法是将右侧栏中的字段拖动到可视化下的轴和值轴。您可以根据要求向每个轴添加多个字段。
In Power BI, you can create visualization in two ways. First is by adding from the right side pane to Report Canvas. By default, it is the table type visualization, which is selected in Power BI. Another way is to drag the fields from right side bar to the axis and value axis under Visualization. You can add multiple fields to each axis as per the requirement.

在 Power BI 中,还可以通过单击然后拖动来移动报告画布上的可视化。您还可以在可视化窗格中切换不同的图表和可视化类型。Power BI 会尽力将您选定的字段尽可能准确地转换成新的可视化类型。
In Power BI, it is also possible to move your visualization on the reporting canvas by clicking and then dragging it. You can also switch between different type of charts and visualizations from the Visualization pane. Power BI attempts to convert your selected fields to the new visual type as closely as possible.
Creating Map Visualizations
在 Power BI 中,我们有两种类型的地图可视化 - 气泡图和形状图。如果您要创建一个气泡图,请从可视化窗格中选择地图选项。
In Power BI, we have two types of map visualization - bubble maps and shape maps. If you want to create a bubble map, select the map option from the visualization pane.

若要使用气泡图,请将地图从可视化拖动到报告画布中。要显示值,您必须向轴添加任何位置对象。
To use a bubble map, drag the map from Visualizations to the Report Canvas. To display values, you have to add any location object to the axis.

在值字段中,您可以看到它接受值轴,如城市和州,或者您可以添加经度和纬度值。要更改气泡大小,您需要向值轴添加一个字段。
In the value fields, you can see that it accepts values axis such as City and State and or you can also add longitude and latitude values. To change the bubble size, you need to add a field to the value axis.
您还可以通过将填充地图拖到报告画布中来在数据可视化中使用填充地图。
You can also use a filled map in data visualization, just by dragging the filled map to the Report Canvas.

Note - 如果你在地图可视化的顶部看到一个警告符号,这意味着你需要向地图图表添加更多位置。
Note − If you see a warning symbol on top of your map visualization, it means that you need to add more locations to your map chart.
Using Combination Charts
在数据可视化中,还需要在一个图表中绘制多维数据。Power BI 支持各种组合图表类型来绘制度量值。假设您想要在一个图表中绘制收入和 unit_solds。组合图表是此类要求最合适的选项。
In data visualization, it is also required to plot multiple measures in a single chart. Power BI supports various combination chart types to plot measure values. Let us say you want to plot revenue and unit_solds in one chart. Combination charts are the most suitable option for these kind of requirement.
Power BI 中最常见的组合图表之一是折线图和堆积柱状图。假设我们有一个收入字段,我们添加了一个新的数据源,其中包含以客户为单位的单位数量,并且我们希望在我们的可视化中绘制它。
One of the most common Combination chart in Power BI is Line and Stacked column charts. Let us say we have a revenue field and we have added a new data source that contains customer-wise unit quantity and we want to plot this in our visualization.

一旦您添加了一个数据源,它将被添加到右侧字段的列表中。您可以将单位添加到列轴,如下面的屏幕截图所示。
Once you add a data source, it will be added to the list of fields on the right side. You can add units to the column axis as shown in the following screenshot.

您可以在 Power BI 中使用其他类型的组合图表 - 折线图和簇状柱形图。
You have other type of combine chart that you can use in Power BI - Line and Clustered Column.

Using Tables
在 Power BI 中,当您向可视化对象添加数据集时,它会向报表画布中添加一个表格图表。您可以拖动您要添加到报表中的字段。您还可以勾选每个字段前面的复选框,以将它们添加到报表区域。
In Power BI, when you add a dataset to your visualization, it adds a table chart to the Report canvas. You can drag the fields that you want to add to the report. You can also select the checkbox in front of each field to add those to the Report area.
对于表格中的数值,您可以在底部看到值的总和。
With the numerical values in a table, you can see a sum of values at the bottom.

您还可以使用列顶部的箭头键对表格进行排序。要执行升序/降序排序,只需单击箭头标记,列中的值将按顺序排序。
You can also perform a sort in the table using an arrow key at the top of the column. To perform ascending/descending sort, just click the arrow mark, and the values in the column will be sorted.

表格中列的顺序由右侧值存储区中的顺序决定。如果您想要更改顺序,您可以删除任何列并添加另一个列。
The order of the columns in a table is determined by the order in the value bucket on the right side. If you want to change the order, you can delete any column and add the other one.

您还可以撤消汇总或对表格中的数值应用不同的聚合函数。要更改聚合类型,单击度量前面的值存储区中的箭头,您将看到可用的公式列表。
You can also undo summarize or apply different aggregate function on numerical values in the table. To change the aggregation type, click the arrow in the value bucket in front of the measure and you will see a list of formulas that can be used.

Power BI 中的另一种表格类型是矩阵表格,它提供了许多特性,例如自动调整大小、列表格和设置颜色等。
Another table type in Power BI is the matrix table that provides a lot of features such as auto sizing, column tables, and setting colors, etc.

Modify Colors in Charts
在 Power BI 中,您还可以修改图表中的颜色。当您选择任何可视化对象时,它都有一个选项来更改颜色。格式选项卡中有以下选项:
In Power BI, you can also modify the colors in the chart. When you select any visualization, it has an option to change the color. Following options are available under the Format tab −
-
Legend
-
Data Colors
-
Detail Label
-
Title
-
Background
-
Lock Aspect
-
Border
-
General
若要打开这些选项,请转至格式选项卡,如以下屏幕截图所示。单击后,您可以看到所有可用选项。
To open these options, go to the Format tab as shown in the following screenshot. Once you click, you can see all the options available.

展开图例字段时,您可以选择要显示图例的位置。您可以选择:
When you expand the Legend field, you have an option where you want to display the legend. You can select −
-
Position
-
Title
-
Legend Name
-
Color
-
Text Size
-
Font Family

类似地,您有数据颜色。如果您想更改任何数据字段的颜色,您可以使用此选项。它显示了图表中的所有对象及其对应的颜色。
Similarly, you have data colors. In case, you want to change the color of any data field, you can use this option. It shows all objects and their corresponding colors in the chart.

您还可以使用此工具中的分析特性,根据数据可视化中的要求绘制线。您在数据可视化中拥有以下线类型:
You also have Analytics feature in the tool, where you can draw lines as per requirement in data visualization. You have the following line types in data visualization −
-
Constant Line
-
Min Line
-
Max Line
-
Average Line
-
Median Line
-
Percentile Line

您可以选择虚线、点线或实线。您可以选择线的透明度级别、颜色和位置。您还可以为此线开启/关闭数据标签。
You can opt for a dashed, dotted, or a solid line. You can select Transparency level, color, and position of the line. You can also switch on/off data label for this line.

Adding Shapes, Images and Text box
有时您需要向可视化中添加静态文本、图像或形状。如果您想向数据可视化中添加页眉/页脚或任何静态签名或消息,可以使用此选项。
Sometimes it is required that you need to add static text, images, or shapes to your visualization. In case you want to add header/footer or any static signatures, messages to data visualization this option can be used.
您还可以在文本框中添加 URL,Power BI 使用这些链接使其保持活动状态。
You can also add URLs in the text box and Power BI uses those link to make it live.
若要添加形状、图像和文本框,请导航到主页选项卡,在顶部您会找到一个添加图像的选项。
To add shapes, images and text box, navigate to the Home tab and at the top you will find an option to add images.

您可以在数据可视化中插入不同的形状。要查看可用形状,请单击形状按钮旁边的箭头。
You can insert different shapes in data visualization. To see the available shapes, click the arrow next to the Shapes button.

当您单击文本框时,它会在您的报表画布中添加一个文本框。您可以在文本框中输入任何文本,并使用富文本编辑器进行格式更改。
When you click on the text box, it adds a text box in your Report canvas. You can enter any text in the text box and use the rich text editor to make formatting changes.

类似地,可以向数据可视化中添加图像以向数据可视化中添加徽标或其他图像。当您单击图像选项时,它会要求提供一个路径来传递图像文件。
Similarly, images can be added to data visualization to add logos or other images to data visualization. When you click the Image option, it asks for a path to pass the image file.
您可以通过从下拉列表中选择任意形状来添加形状。您还可以使用不同的选项对其进行调整。
You can add shapes by selecting any shape from the dropdown list. You can also resize it using different options.

Styling Reports
在 Power BI 中,您有灵活的选项可用于调整页面布局和格式,例如方向和报表页面大小。从“开始”选项卡导航到“页面视图”菜单,系统将提供以下选项。
In Power BI, you have flexible options to adjust the page layout and formatting such as orientation and page size of your report. Navigate to Page View menu from the Home tab and the following options are provided.
-
Fit to Page
-
Fit to Width
-
Actual Size

默认情况下,报表中的页面大小为 16:9;但是,也可以更改报表的页面大小。若要更改页面大小,请导航到“可视化效果”窗格,然后选择“画笔”。
By default, the page size in a report is 16:9; however, it is also possible to change the page size of the report. To change the page size, navigate to the Visualization pane and select Paint brush.
Note - 若要更改页面大小,请勿向报表画布中添加任何可视化效果。在“页面布局”下有以下可用选项:
Note − To change page size, no visualization should be added to the Report canvas. You have the following options available under Page layout −
-
Page Information
-
Page Size
-
Page Background
在“页面信息”下,您将看到“名称”和“问答”。
Under Page Information, you have Name and Q&A.
在“页面大小”下,您可从以下选项中进行选择:
Under Page Size, you can select from the following options −
-
Type
-
Width
-
Height

在“页面背景”下,您可从以下选项中进行选择:
Under Page Background, you can select from the following options:
-
Color
-
Transparency
-
Add Image

Duplicating Reports
在某些情况下,您可能想对不同的页面使用相同的布局和视觉对象。Power BI 提供了创建页面副本的选项。使用“复制页面”选项后,将添加一个具有类似布局和视觉对象的新页面。
In some scenarios, you may want to use the same layout and visuals for different pages. Power BI provides an option to create a copy of the page. When you use Duplicate Page option, a new page is added with similar layout and visuals.
若要复制页面,请右键单击“页面”,然后选择“复制页面”选项。这将创建一个具有相同页面名称的副本 - 复制的 Page1。
To duplicate a page, right-click the Page and select Duplicate Page option. This will create a copy of the same page with the name - Duplicate of Page1.

现在,如果您想重命名现有页面或删除页面,您可以使用其他选项,如以上屏幕截图所示。
Now, if you want to rename an existing page or delete a page, you can use other options as shown in the above screenshot.