什么是 Power BI Desktop?What is Power BI Desktop?

Power BI Desktop 是一款可在本地计算机上安装的免费应用程序,可用于连接到数据、转换数据并实现数据的可视化效果。Power BI Desktop is a free application you can install on your local computer that lets you connect to, transform, and visualize your data. 借助 Power BI Desktop ,可以连接到多个不同数据源并将它们(通常称为“建模”)合并到数据模型中,该模型允许用户生成可作为报表与组织内的其他人共享的视觉对象和视觉对象集合。With Power BI Desktop, you can connect to multiple different sources of data, and combine them (often called modeling) into a data model that lets you build visuals, and collections of visuals you can share as reports, with other people inside your organization. 致力于商业智能项目的大多数用户使用 Power BI Desktop 创建报表,然后使用 Power BI 服务 与其他人共享其报表。Most users who work on Business Intelligence projects use Power BI Desktop to create reports, and then use the Power BI service to share their reports with others.

Power BI Desktop

Power BI Desktop 的最常见用途如下:The most common uses for Power BI Desktop are the following:

  • 连接到数据Connect to data
  • 转换和清除该数据,以创建数据模型Transform and clean that data, to create a data model
  • 创建视觉对象,如提供数据的可视化表示形式的图表或图形Create visuals, such as charts or graphs, that provide visual representations of the data
  • 在一个或多个报表页上创建作为视觉对象集合的报表Create reports that are collections of visuals, on one or more report pages
  • 使用 Power BI 服务与其他人共享报表Share reports with others using the Power BI service

最常负责此类任务的人员通常被视为“数据分析师” (有时简称为“分析师” )或“商业智能专业人员”(通常称为“报表创建者” )。People most often responsible for such tasks are often considered data analysts (sometimes just referred to as analysts) or Business Intelligence professionals (often referred to as report creators). 但是,不将自己视为分析师或报表创建者的许多人使用 Power BI Desktop 创建引人注目的报表,或拉取来自各个源的数据并生成可与其同事和组织共享的数据模型。However, many people who don't consider themselves an analyst or a report creator use Power BI Desktop to create compelling reports, or to pull data from various sources and build data models, which they can share with their coworkers and organizations.

Power BI Desktop 中有三个视图,它们显示在画布的左侧。There are three views in Power BI Desktop, shown along the left side of the canvas. 视图显示的顺序如下所示:The views, shown in the order they appear, are the following:

  • 报表视图 - 可以在其中创建报表和视觉对象,并花费大部分时间执行创建操作。Report View - this is where you create reports and visuals, and where most of your creation time is spent.
  • 数据视图 - 在此处可以查看与报表关联的数据模型中使用的表、度量值和其他数据,并转换数据以便在报表的模型中充分利用。Data View - here you can see the tables, measures, and other data used in the data model associated with your report, and transform the data for best use in the report's model.
  • 模型视图 - 在此视图中,可以查看和管理数据模型中各表之间的关系。Model View - in this view you see and manage the relationships among tables in your data model.

下图显示了在画布左侧显示的三个视图:The following image shows the three Views, as displayed along the left side of the canvas:

不同的视图

借助 Power BI Desktop ,可以使用来自多个源的数据创建复杂且视觉效果丰富的报表,即可与组织中的其他人共享的多合一报表。With Power BI Desktop you can create complex and visually rich reports, using data from multiple sources, all in one report that you can share with others in your organization.

连接到数据Connect to data

要开始使用 Power BI Desktop ,第一步为连接到数据。To get started with Power BI Desktop, the first step is to connect to data. 可从 Power BI Desktop 连接到多个不同数据源。There are many different data sources you can connect to from Power BI Desktop. 要连接到数据,只需选择“主页” 功能区,然后选择“获取数据”>“更多” 。To connect to data, simply select the Home ribbon, then select Get Data > More. 下图显示出现的“获取数据”窗口 ,其中显示了 Power BI Desktop 可连接到的多个类别。The following image shows the Get Data window that appears, showing the many categories to which Power BI Desktop can connect.

在 Power BI Desktop 中获取数据

选择数据类型时,系统会提示输入 Power BI Desktop 代表你连接到数据源所需的 URL 和凭据等信息。When you select a data type, you're prompted for information, such as the URL and credentials, necessary for Power BI Desktop to connect to the data source on your behalf.

在 Power BI Desktop 中连接到 SQL Server 数据库

连接到一个或多个数据源后,可能希望转换数据,因此这样做对你非常有用。Once you connect to one or more data sources, you may want to transform the data so it's useful for you.

转换和清除数据、创建模型Transform and clean data, create a model

在 Power BI Desktop 中,可以使用内置查询编辑器 清除并转换数据。In Power BI Desktop, you can clean and transform data using the built-in Query Editor. 使用查询编辑器可以对数据进行更改,如更改数据类型、删除列或合并来自多个源的数据。With Query Editor you can make changes to your data, such as changing a data type, removing columns, or combining data from multiple sources. 这有点像雕刻,你可以从大块泥土(或数据)开始,然后进行刮削或根据需要添加其他,直到数据形状符合你的要求。It's a little bit like sculpting - you can start with a large block of clay (or data), then shave pieces off or add others as needed, until the shape of the data is how you want it.

Power BI Desktop 中的查询编辑器

查询编辑器 会记录转换数据过程中采取的每个步骤(如重命名表格、转换数据类型或删除列),且每当此查询连接到数据源时,都会执行这些步骤,因此数据将始终按你指定的方式进行调整。Each step you take in transforming data (such as rename a table, transform a data type, or delete columns) is recorded by Query Editor, and each time this query connects to the data source those steps are carried out so that the data is always shaped the way you specified.

下图显示已调整并转换为模型的查询的“查询设置” 窗格。The following image shows the Query Settings pane for a query that has been shaped, and turned into a model.

数据符合你的要求后,即可创建视觉对象。Once your data is how you want it, you can create visuals.

创建视觉对象Create visuals

拥有数据模型后,即可将字段 拖动到报表画布上以创建视觉对象 。Once you have a data model, you can drag fields onto the report canvas to create visuals. 视觉对象 是模型中的数据的图形表示形式。A visual is a graphic representation of the data in your model. 以下视觉对象显示一个简单的柱形图。The following visual shows a simple column chart.

Power BI Desktop 中的视觉对象

可以在 Power BI Desktop 中选择多个不同类型的视觉对象。There are many different types of visuals to choose from in Power BI Desktop. 若要创建或更改视觉对象,只需从“可视化效果”窗格中选择视觉对象图标 。To create or change a visual, just select the visual icon from the Visualizations pane. 如果已在报表画布上选择一个视觉对象,则选定的视觉对象将更改为所选的类型。If you have a visual selected on the report canvas, the selected visual changes to the type you selected. 如果未选择任何视觉对象,将根据你的选择创建新的视觉对象。If no visual is selected, a new visual is created based on your selection.

Power BI Desktop 中的“可视化效果”窗格

创建报表Create reports

通常,你会想要创建视觉对象集合,这些视觉对象可显示已用于在 Power BI Desktop 中创建模型的数据的各个方面。More often, you'll want to create a collection of visuals that show various aspects of the data you have used to create your model in Power BI Desktop. 一个 Power BI Desktop 文件中的视觉对象集合称为“报表” 。A collection of visuals, in one Power BI Desktop file, is called a report. 报表可以有一个或多个页面,就像 Excel 文件可以有一个或多个工作表。A report can have one or more pages, just like an Excel file can have one or more worksheets. 在下图中,你将看到 Power BI Desktop 报表的首页,名为“概述”(你可以看到图像底部附近的选项卡)。In the following image you see the first page of a Power BI Desktop report, named Overview (you can see the tab near the bottom of the image). 在此报表中,有十个页面。In this report, there are ten pages.

具有十个页面的 Power BI Desktop 报表

共享报表Share reports

准备好与其他人共享报表后,可以将报表发布 到 Power BI 服务 ,并使其可供组织中拥有 Power BI 许可证的任何人使用。Once a report is ready to share with others, you can Publish the report to the Power BI service, and make it available to anyone in your organization who has a Power BI license. 若要发布 Power BI Desktop 报表,可在 Power BI Desktop 中从“主页”功能区选择“发布”按钮 。To publish a Power BI Desktop report, you select the Publish button from the Home ribbon in Power BI Desktop.

从 Power BI Desktop 发布报表

选择“发布” 后,Power BI Desktop 会使用 Power BI 帐户连接到 Power BI 服务 ,然后提示你选择 Power BI 服务中想要共享报表的位置,例如,你的工作区、团队工作区或 Power BI 服务中的一些其他位置。Once you select Publish, Power BI Desktop connects you to the Power BI service using your Power BI account, and then prompts you to select where in the Power BI service you would like to share the report, such as your workspace, a team workspace, or some other location in the Power BI service. 必须具有 Power BI 许可证才能将报表共享到 Power BI 服务。You must have a Power BI license to share reports to the Power BI service.

后续步骤Next steps

要开始使用 Power BI Desktop,首先需要下载并安装应用程序 。To get started with Power BI Desktop, the first thing you need is to download and install the application. 有两种方法可用于获取 Power BI Desktop :There are two ways to get Power BI Desktop: