Power BI Desktop 入门Getting started with Power BI Desktop

欢迎使用 Power BI Desktop 入门指南Welcome to the Power BI Desktop Getting Started Guide. 此 Power BI Desktop 简短教学课程能让你熟悉它的运作方式、示范它的功能以及加速你构建稳固数据模型的能力 - 以令人惊叹的报表增强你的商业智慧工作。This short tour of Power BI Desktop gets you acquainted with how it works, demonstrates what it can do, and accelerates your ability to build robust data models — along with amazing reports — that amplify your business intelligence efforts.

更愿意观看而不是阅读吗?Prefer to watch instead of read? 欢迎观看我们的入门视频Feel free to take a look at our getting started video. 如果你想要遵循视频及相匹配的示例数据,则可下载此示例性 Excel 工作簿And if you want to follow along with the video with matching sample data, you can download this sample Excel workbook.

Power BI Desktop 可让你创建查询、数据连接和报表的集合,轻松地与他人共享。Power BI Desktop lets you create a collection of queries, data connections, and reports that can easily be shared with others. Power BI Desktop 集成了经验证的 Microsoft 技术 – 强大的查询引擎、数据建模和可视化效果 – 与在线 Power BI 服务无缝配合。Power BI Desktop integrates proven Microsoft technologies – the powerful Query engine, data modeling, and visualizations – and works seamlessly with the online Power BI service.

通过将 Power BI Desktop 其中分析师和其他人可以创建功能强大的数据连接、模型和报表)和 Power BI 服务(其中可以共享 Power BI Desktop 报表,因此用户能够查看并与其进行交互)相结合,数据世界的新见解可以更轻松地建模、生成、共享和扩展。With the combination of Power BI Desktop (where analysts and others can create powerful data connections, models and reports) and the Power BI service (where Power BI Desktop reports can be shared so users can view and interact with them), new insights from the world of data are easier to model, build, share, and extend.

数据分析师会发现 Power BI Desktop 是个功能强大、有弹性且高度可存取的工具,可以连接和塑造数据世界、构建稳固的模型以及制作结构良好的报表。Data analysts will find Power BI Desktop a powerful, flexible, and a highly accessible tool to connect with and shape the world of data, build robust models, and craft well-structured reports.

如何使用本指南How to use this guide

你可以使用好几种方法使用本指南 - 扫描它以取得快速概述,或阅读每一部分以充分了解 Power BI Desktop 的运作方式。You can use this guide in a couple of ways – scan it for a quick overview, or read through each section for a strong understanding of how Power BI Desktop works.

如果你赶时间,可以在几分钟内快速扫视本指南,并且能够判断 Power BI Desktop 的运作方式及其使用方法。If you’re in a hurry you can do a visual sweep of this guide in just a couple minutes, and come away with a good sense of how Power BI Desktop operates, and how to use it. 本指南的大部分内容是以视觉方式演示 Power BI Desktop 的运作方式的画面。Most of this guide consists of screens that visually show how Power BI Desktop works.

若要更深入了解,你也可以阅读每一部分、执行这些步骤,然后带走你自己的 Power BI Desktop 文件,该文件随时都可发布到 Power BI 服务,并与他人共享。For a more thorough understanding you can read through each section, perform the steps, and walk away with your own Power BI Desktop file that’s ready to post onto the Power BI service, and share with others.

备注

此外,还有一个称作 Power BI 报表服务器Power BI 独立专业版本,它面向需要在本地保留数据和报表的客户。There is also a separate and specialized version of Power BI called Power BI Report Server, which is for customers who need their data and reporting to remain on-premises. 与该专业版本配合使用的,还有一个称作适用于 Power BI 报表服务器的 Power BI DesktopPower BI Desktop 独立专业版本,该版本仅适用于 Power BI 的报表服务器版本。For use with that specialized version, there's also a separate and specialized version of Power BI Desktop called Power BI Desktop for Power BI Report Server, which works only with the Report Server version of Power BI. 本文介绍标准版 Power BI DesktopThis article describes the standard Power BI Desktop.

Power BI Desktop 工作原理How Power BI Desktop works

使用 Power BI Desktop,你可以 连接到数据 (通常多个数据源), 调整该数据 (使用能生成具洞察力、吸引力的数据模型的查询),以及使用该模型来 创建报表 (他人可以利用、以其为基础构建并共享)。With Power BI Desktop, you connect to data (usually multiple data sources), shape that data (with queries that build insightful, compelling data models), and use that model to create reports (which others can leverage, build upon, and share).

按你要求完成步骤后(连接、调整和报表),你可以将工作保存为 Power BI Desktop 文件格式,其扩展名为 .pbix。When the steps are completed to your satisfaction – connect, shape, and report – you can save that work in Power BI Desktop file format, which is the .pbix extension. Power BI Desktop 文件可以像其他文件一样共享,但共享 Power BI Desktop 文件最引人注目的方式是将其上传(共享)到 Power BI 服务Power BI Desktop files can be shared like any other file, but the most compelling way to share Power BI Desktop files is to upload them (share them) on the Power BI service.

Power BI Desktop 会集中、简化并效率化设计与创建商业智能存储库和报表的程序,这些程序可能是散乱、不相关且棘手的。Power BI Desktop centralizes, simplifies, and streamlines what can otherwise be a scattered, disconnected, and arduous process of designing and creating business intelligence repositories and reports.

准备好要试一试吗?Ready to give it a try? 让我们开始吧。Let’s get started.

安装并运行 Power BI DesktopInstall and run Power BI Desktop

你可以在 Power BI 服务中下载 Power BI Desktop,方法是先选择齿轮图标,然后选择 Power BI DesktopYou can download Power BI Desktop from the Power BI service, by selecting the gear icon, then select Power BI Desktop.

Power BI Desktop 会当作一个应用程序进行安装,并在桌面上运行。Power BI Desktop is installed as an application, and runs on your desktop.

当你运行 Power BI Desktop 时,将显示 欢迎 界面。When you run Power BI Desktop, a Welcome screen is displayed.

你可以直接从 欢迎 (左窗格中的链接)界面 获取数据 、查看 最近的数据源打开其他 报表You can Get Data, see Recent Sources, or Open Other Reports directly from the Welcome screen (from the links in the left pane). 如果关闭该界面(选择右上角的 x),则会显示 Power BI Desktop 的报表视图。If you close the screen (select the x in the top right corner), the Report view of Power BI Desktop is displayed.

Power BI Desktop 中有三种视图:报表视图、数据视图和关系视图。There are three views in Power BI Desktop: Report view, Data view, and Relationships view. Power BI Desktop 还包含 查询编辑器,其会在单独的窗口打开。Power BI Desktop also includes Query Editor, which opens in a separate window. 查询编辑器中,你可以生成查询和转换数据,然后将经过优化的数据模型加载到 Power BI Desktop,并创建报表。In Query Editor, you can build queries and transform data, then load that refined data model into Power BI Desktop, and create reports.

下面的屏幕沿 Power BI Desktop 左侧自上而下显示了三个视图图标:报表数据关系The following screen shows the three view icons along the left of Power BI Desktop: Report, Data, and Relationships, from top to bottom. 当前显示的视图以左侧的黄色条表示。The currently displayed view is indicated by the yellow bar along the left. 在此示例中,当前显示了报表视图。In this case, Report view is currently displayed. 你可以通过选择这三个图标的任意一个更改视图。You can change views by selecting any of those three icons.

安装 Power BI Desktop 后,你就可以连接到数据、调整数据以及生成报表(通常是依此顺序)。With Power BI Desktop installed you’re ready to connect to data, shape data, and build reports (usually in that order). 在下面几部分中,我们会依次介绍每一项。In the next few sections, we take a tour through each in turn.

连接到数据Connect to data

安装 Power BI Desktop 后,你就可以连接到持续扩展的数据世界。With Power BI Desktop installed, you’re ready to connect to the ever expanding world of data. 查询窗口中有 各种 可用的数据源。There are all sorts of data sources available in the Query window. 下图显示了如何连接到数据,通过选择开始功能区,然后选择获取数据 > 更多The following image shows how to connect to data, by selecting the Home ribbon, then Get Data > More.

在此快速教程中,我们将连接到几个不同的 Web 数据源。For this quick tour, we'll connect to a couple different Web data sources.

假设你即将退休 – 你想要住在很多阳光、税制合理且具有良好医疗卫生的地方 - 或者也许你是数据分析师,你想要该信息来帮助你的客户。Imagine you’re retiring – you want to live where there’s lots of sunshine, preferable taxes, and good health care – or perhaps you’re a data analyst, and you want that information to help your customers. 例如,你可能希望帮助太阳镜零售商达到最晴朗区域的销售量。For example, perhaps you want to help your sunglasses retailer target sales where the sun shines most frequently.

无论如何,下列 Web 资源具有关于这些话题的相关和详细数据:Either way, the following Web resource has interesting data about those topics, and more:

http://www.bankrate.com/finance/retirement/best-places-retire-how-state-ranks.aspx

选择获取数据 > Web 并粘贴地址。Select Get Data > Web and paste the address.

选择确定后,Power BI Desktop 的查询功能就会开始运行。When you select OK, the Query functionality of Power BI Desktop goes to work. 查询会联系 Web 资源,导航器窗口将返回它在此网页上找到的信息。Query contacts the Web resource, and the Navigator window returns what it found on that Web page. 在本例中,它找到一个表格( 表格 0 )和整个 Web 文档。In this case, it found a table (Table 0) and the overall Web Document. 我们对该表有兴趣,因此我们从列表中选择它。We’re interested in the table, so we select it from the list. 导航器窗口会显示预览。The Navigator window displays a preview.

此时我们可以通过从窗口底部选择编辑,先编辑查询再加载表,或者我们可以直接加载表。At this point we can edit the query before loading the table, by selecting Edit from the bottom of the window, or we can load the table.

选择编辑后,查询编辑器就会启动并且会呈现表的代表视图。When we select Edit, Query Editor launches and a representative view of the table is presented. 会显示查询设置窗格(若未显示,可以从功能区选择视图,然后依次选择显示 > 查询设置来显示查询设置窗格)。The Query Settings pane is displayed (if it’s not, you can select View from the ribbon, then Show > Query Settings to display the Query Settings pane). 以下是其外观。Here’s what that looks like.

有关连接到数据的详细信息,请参阅通过 Power BI Desktop 连接到数据For more information about connecting to data, see Connect to Data in Power BI Desktop.

下一部分,我们将调整数据,使其满足我们的需求。In the next section, we adjust the data so it meets our needs. 调整连接数据的过程被称为 调整 数据。The process of adjusting connected data is called shaping data.

调整和合并数据Shape and combine data

由于我们已经连接到数据源,我们需要调整数据以符合我们的需求。Now that we’ve connected to a data source, we need to adjust the data to meet our needs. 有时候调整意味着 转换 数据,例如重命名列或表格、将文字更改为数字、删除行、将第一列设置为标题列等。Sometimes adjusting means transforming the data – such as renaming columns or tables, changing text to numbers, removing rows, setting the first row as headers, and so on.

Power BI Desktop 中的查询编辑器除能在功能区中提供可用的工作,还能够充分利用右键菜单。The Query editor in Power BI Desktop makes ample use of right-click menus, in addition to having tasks available on the ribbon. 大部分可在转换功能区选择的内容也可通过右键单击项目(如某列)并从所显示的菜单中进行选择。Most of what you can select in the Transform ribbon is also available by right-clicking an item (such as a column) and choosing from the menu that appears.

调整数据Shape data

如果在查询编辑器中调整数据,你将在查询编辑器加载并呈现数据时提供分步说明(查询编辑器将为你执行此操作)以调整数据。When you shape data in the Query Editor, you’re providing step-by-step instructions (that Query Editor carries out for you) to adjust the data as Query Editor loads and presents it. 原始数据源不受影响,将仅调整或 整理 这一特定的数据视图。The original data source is not affected; only this particular view of the data is adjusted, or shaped.

查询编辑器会记录你指定的步骤(如重命名表格、转换数据类型或删除列),且每当此查询连接到数据源时,都会执行这些步骤,因此数据将始终按你指定的方式进行调整。The steps you specify (such as rename a table, transform a data type, or delete columns) are 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 specify. 每当你在 Power BI Desktop 中使用查询时,或任何人使用你的共享查询(在如 Power BI 服务上)时,都会进行过程。This process occurs whenever you use the query in Power BI Desktop, or for anyone who uses your shared query, such as in the Power BI service. 这些步骤是在所应用步骤查询设置窗格中按顺序进行捕获的。Those steps are captured, sequentially, in the Query Settings pane under Applied Steps.

下图显示已调整查询的查询设置窗格,我们将于接下来几个段落中逐一说明每个步骤。The following image shows the Query Settings pane for a query that has been shaped – we’ll go through each of those steps in the next few paragraphs.

让我们回到退休数据(退休数据是我们通过连接到 Web 数据源找到的),并调整数据以符合我们的需求。Let’s get back to our retirement data, which we found by connecting to a Web data source, and shape that data to fit our needs.

对于初学者,大部分评分都是以整数带入至查询编辑器,但并非全都如此(一个列包含了文本和数字,因此它不会自动转换)。For starters, most ratings were brought into Query Editor as whole numbers, but not all of them (one column contained text and numbers, so it wasn't automatically converted). 而我们需要该数据为数字。We need the data to be numbers. 没问题 – 只要右键单击数据列标题,然后选择更改类型 > 整数来更改数据类型。No problem – just right-click the column header, and select Change Type > Whole Number to change the data type. 如果我们需要选择多个数据列,可以先选择数据列然后再按住 Shift,选择其他相邻的数据行,然后右键单击数据列标题以更改所有选择的数据列。If we needed to choose more than one column, we could first select a column then hold down SHIFT, select additional adjacent columns, and then right-click a column header to change all selected columns. 你也可以使用 Ctrl 选择非相邻的数据列。You can also use CTRL to select non-adjacent columns.

你还可以使用 转换 功能区,将那些数据列从文本更改或 转换 为标题。You can also change, or transform, those columns from text to header by using the Transform ribbon. 转换功能区显示如下,其中箭头指向数据类型按钮,可用于将当前数据类型转换成其他数据类型。Here’s the Transform ribbon, with an arrow pointing toward the Data Type button, which lets you transform the current data type to another.

注意,在查询设置中,所应用步骤会反映已做的更改。Note that in Query Settings, the Applied Steps reflect the changes that were made. 如果要删除调整过程中的任何步骤,只需选择该步骤,然后选择步骤左边的 XIf I want to remove any step from the shaping process, I simply select that step, and then select the X to the left of the step.

我们需要再做一些更改,让查询位于我们想要的位置:We need to make a few more changes to get the query where we want it:

  • 删除第一列 – 不需要此列,它仅包含指出“查看你所在州的退休评级”的重复行,这是此数据源成为基于 Web 的表格的项目Remove the first column – we don’t need it, it just includes redundant rows that say “Check out how your state ranks for retirement” which is an artifact of this being a Web based table
  • 修复一些错误 – 在网页上,有一列有混合数字的文字(某些州结合在一个类别中)。Fix a few Errors – on the Web page, one column had text mixed in with the numbers (some states tied in one category). 其在该网站上运作很好,但并不适合我们的数据分析。That works well in the website, but not for our data analysis. (在此示例中)错误很容易修复,并显示了查询编辑器及其所应用步骤中一些很棒的特性和功能。It's easy (in this case) to fix, and shows some cool features and capabilities of Query Editor and its Applied Steps
  • 更改表格名称 - 表格 0不是有用的描述符,但更改它很简单Change the Table Name – that Table 0 is not a useful descriptor, but changing it simple

每个步骤都演示于在 Power BI Desktop 中调整和合并数据Each of these steps is demonstrated in Shape and Combine Data in Power BI Desktop. 欢迎参阅该页面,或继续阅读这份文档,了解你接下来要做什么。Feel free to check out that page, or keep going in this document to see what you would do next. 下一部分会在应用上述更改之后继续。The next section picks up after the changes above are applied.

合并数据Combine data

有关各州的那份数据很有趣,而且适用于生成其他分析工作和查询。That data about various states is interesting, and will be useful for building additional analysis efforts and queries. 但是有一个问题:大多数数据使用两个字母的州名代码缩写,而不是该州的完整名称。But there’s one problem: most data out there uses a two-letter abbreviation for state codes, not the full name of the state. 我们需要某种方式来建立州名及其缩写的关联。We need some way to associate state names with their abbreviations.

我们很幸运:有另一个公共数据源可执行该项工作,但还需要进行相当多的调整,才能连接到我们的退休表。We’re in luck: there’s another public data source that does just that, but it needs a fair amount of shaping before we can connect it to our retirement table. 以下是州名缩写的 Web 资源:Here’s the Web resource for state abbreviations:

http://en.wikipedia.org/wiki/List_of_U.S._state_abbreviations

查询编辑器中的开始功能区,选择获取数据 > Web 并键入地址,选择确定导航器窗口将显示它在此网页上找到的信息。From the Home ribbon in Query Editor, we select Get Data > Web and type the address, select OK, and the Navigator window shows what it found on that Web page.

我们选择编辑表,因为它包含我们想要的数据,但它需要大量调整才能将表格中的数据削减到所需数据。We select Table[edit] because it includes the data we want, but it’s going to take quite a bit of shaping to pare that table’s data down. 每个步骤都演示于在 Power BI Desktop 中调整和合并数据Each of these steps is also demonstrated in Shape and Combine Data in Power BI Desktop. 汇总这些步骤,下面是我们要执行的操作:To summarize those steps, here's what we do:

选择编辑,然后:We select Edit, then:

  • 删除前两行 – 它们是创建网页表格所产生的,不是所需的行。Remove the top two rows – they’re a result of the way that Web page’s table was created, and we don’t need them.
  • 删除底部的 26 行 – 它们全是地区,无需包含在内。Remove the bottom 26 rows – they’re all the territories, which we don’t need to include.
  • 筛选出华盛顿特区 – 退休统计数据的表不包含华盛顿特区,因此我们从列表中将其排除。Filter out Washington DC – the retirement stats table doesn't include DC, so we'll exclude it from our list.
  • 删除一些不必要的列 – 只需将州映射到其两个字母的官方缩写,因此可以删除其他数据列。Remove a few unneeded columns – we only need the mapping of state to its official two-letter abbreviation, so we can remove the other columns.
  • 将第一行用作标题 - 由于已删除前 3 行,所以当前的首行就是所需的标题。Use the first row as headers – since we removed the top three rows, the current top row is the header we want.

    备注

    此时非常适合指出:查询编辑器所应用步骤的序列是至关重要的,可能会影响数据调整的方式。This is a good time to point out that the sequence of applied steps in Query Editor is important, and can affect how the data is shaped. 同时也必须考虑一个步骤对另一个后续的步骤可能会有什么影响;如果你从所应用步骤中删除一个步骤,则由于查询中步骤顺序的影响,后续步骤可能不会按原本所期望的方式进行。It’s also important to consider how one step may impact another subsequent step; if you remove a step from the Applied Steps, subsequent steps may not behave as originally intended, because of the impact of the query’s sequence of steps.

  • 重命名列和表格本身 – 通常会有几种方式可以重命名列,你可以选择你偏好的方式。Rename the columns, and the table itself – as usual, there are a couple ways to rename a column, you can choose whichever you prefer.

调整 StateCodes 表格后,我们可以将这两个表或查询合并成一个。由于当前具有的表格是我们对数据应用查询的结果,因此它们通常称为 查询With the StateCodes table shaped, we can combine these two tables, or queries, into one; since the tables we now have are a result of the queries we applied to the data, they’re often referred to as queries.

有两种主要方法可合并查询 – 合并追加There are two primary ways of combining queries – merging and appending.

当你有一列或多列要添加到另一个查询时,你可合并这些查询。When you have one or more columns that you’d like to add to another query, you merge the queries. 当你有其他列要添加到现有查询时,你可追加查询。When you have additional rows of data that you’d like to add to an existing query, you append the query.

本例中,我们要合并查询。In this case we want to merge queries. 首先,我们选择想让其他查询合并 进去 的查询,然后从功能区的 开始 选项卡中选择 合并查询To get started, we select the query into which we want the other query to merge, then select Merge Queries from the Home tab on the ribbon.

将显示合并窗口,提示我们选择想要合并到所需表中的表格,然后选择要用于合并的匹配列。The Merge window appears, prompting us to select which table we’d like merged into the selected table, and then, the matching columns to use for the merge. RetirementStats 表(查询)中选择 ,然后选择 StateCodes 查询(本例中很简单,因为仅有一个其他查询 - 在连接到多个数据源时,存在可从中选择的多个查询)。Select State from the RetirementStats table (query), then select the StateCodes query (easy in this case, since there’s only one other query – when you connect to many data sources, there are many queries to choose from). 在选择正确的匹配列时( RetirementStats 中的 StateCodes 中的 州名 ), 合并 窗口如下所示,且 确定 按钮已启用。When we select the correct matching columns – State from RetirementStats, and State Name from StateCodes – the Merge window looks like the following, and the OK button is enabled.

在查询的结尾会创建 NewColumn,它是与现有查询合并的表(查询)内容。A NewColumn is created at the end of the query, which is the contents of the table (query) that was merged with the existing query. 来自合并查询的所有列均压缩到 NewColumn 中,但可选择展开表格并包含所需的任意列。All columns from the merged query are condensed into the NewColumn, but you can select to Expand the table, and include whichever columns you want. 若要展开合并的表格,并选择要包含的列,请选择展开图示 ()。To expand the merged table, and select which columns to include, select the expand icon (). 展开窗口随即出现。The Expand window appears.

在此示例中,我们只需要 州代码 列,因此仅选择此列,然后选择 确定In this case, we only want the State Code column, so we select only that column and then select OK. 清除 使用原始列名作为前缀 ,因为我们不需要也不想要它,如果我们保留选择它,则合并的列将命名为 NewColumn.State Code (原始列名,或 NewColumn ,然后接一个点,再接要带入查询的列名)。We clear the checkbox from Use original column name as prefix because we don’t need or want that; if we leave that selected, the merged column would be named NewColumn.State Code (the original column name, or NewColumn, then a dot, then the name of the column being brought into the query).

备注

想尝试了解如何引入此 NewColumn 表吗?Want to play around with how to bring in that NewColumn table? 你可以试验一下,如果不喜欢结果,只需从查询设置窗格中所应用步骤列表删除该步骤,你的查询便会回到应用展开步骤之前的状态。You can experiment a bit, and if you don’t like the results, just delete that step from the Applied Steps list in the Query Settings pane; your query returns to the state prior to applying that Expand step. 这就像是个自由重做的机会,你可以不限次数地任意执行,直到展开过程看起来是你要的方式为止。It’s like a free do-over, which you can do as many times as you like until the expand process looks the way you want it.

我们现在有合并两个数据源的单一查询 (表格),其中每个数据源都已经过调整以符合我们的需求。We now have a single query (table) that combined two data sources, each of which has been shaped to meet our needs. 此查询可以作为许多其他相关数据连线的基础 – 例如任何州的住房成本统计数据、人口统计数据或工作机会。This query can serve as a basis for lots of additional, interesting data connections – such as housing cost statistics, demographics, or job opportunities in any state.

有关每个调整及合并数据步骤的更完整说明,请参阅在 Power BI Desktop 调整和合并数据For a more complete description of each of these shape and combine data steps, see Shape and Combine Data in Power BI Desktop.

到目前为止,我们有足够的数据在 Power BI Desktop 内创建一些相关报表。For now, we have enough data to create a few interesting reports, all within Power BI Desktop. 由于这是一个里程碑,让我们保存该 Power BI Desktop 文件 – 我们称它为 Power BI Desktop 入门Since this is a milestone let’s save this Power BI Desktop file – we’ll call it Getting Started with Power BI Desktop. 若要在查询编辑器应用更改,并将其加载到 Power BI Desktop,请从开始功能区选择关闭并应用To apply the changes in Query Editor and load them into Power BI Desktop, select Close & Apply from the Home ribbon.

生成报表Build reports

加载表格之后可以进行其他更改,而且你可以重新加载模型来应用所做的任何更改。Additional changes can be made after the table is loaded, and you can reload a model to apply any changes you make. 但是目前这样就够了。But for now this will do. 在 Power BI Desktop 报表视图中,你可以开始生成报表。In Power BI Desktop Report view, you can begin to build reports.

报表视图具有五个主要区域:The Report view has five main areas:

  1. 功能区,用于显示与报表和可视化效果相关联的常见任务The ribbon, which displays common tasks associated with reports and visualizations
  2. 报表视图或画布,可在其中创建和排列可视化效果The Report view, or canvas, where visualizations are created and arranged
  3. 底部的页面选项卡,用于选择或添加报表页The Pages tab area along the bottom, which lets you select or add a report page
  4. 可视化效果窗格,你可以在其中更改可视化效果、自定义颜色或轴、应用筛选器、拖动字段等The Visualizations pane, where you can change visualizations, customize colors or axes, apply filters, drag fields, and more
  5. 字段窗格,可在其中将查询元素和筛选器拖到报表视图,或拖到可视化效果筛选器窗格The Fields pane, where query elements and filters can be dragged onto the Report view, or dragged to the Filters area of the Visualizations pane

通过选择边缘的小箭头,可以折叠可视化效果字段窗格,以便在报表视图中提供更多空间以生成炫酷的可视化效果。The Visualizations and Fields pane can be collapsed by selecting the small arrow along the edge, providing more space in the Report view to build cool visualizations. 修改可视化效果时,你会看到这些箭头朝上或朝下,这意味着你可以相应展开或折叠该部分。When modifying visualizations, you'll also see these arrows pointing up or down, which means you can expand or collapse that section, accordingly.

若要创建可视化效果,只需将字段从字段列表拖到报表视图即可。To create a visualization, just drag a field from the Fields list onto the Report view. 在此示例中,我们来拖动 RetirementStats 中的 字段,看看会发生什么。In this case, let’s drag the State field from RetirementStats, and see what happens.

看一下...Power BI Desktop 自动创建了基于地图的可视化效果,因为它识别到 字段包含地理位置数据。Look at that... Power BI Desktop automatically created a map-based visualization, because it recognized that the State field contained geolocation data.

注意,在可视化效果窗格中,可以选择不同类型的可视化效果,而且在那些图示下方的区域中,可以将字段拖至不同区域以应用图例,或修改可视化效果。Notice that in the Visualizations pane, I can select different types of visualizations, and in the area below those icons, I can drag fields to different areas to apply a Legend, or otherwise modify the visualization.

快进一点看看报表视图在添加了一些可视化效果以及新报表页面之后的外观。Let’s fast-forward a bit, and see what the Report view looks like after a handful of visualizations have been added, as well as a few new Report pages. 有关报表的详细信息,请参阅 Power BI Desktop 中的报表视图For more information about reports, see Report View in Power BI Desktop.

报表第一页提供的是基于 总体排名 的数据分析。The first Report page provides a perspective of the data based on Overall rank. 当我们选择一个可视化效果,字段和筛选器窗格将显示所选字段和可视化效果的结构(字段应用到共享轴列值行值)。When we select one of the visualizations, the Fields and Filters pane shows which fields are selected, and the structure of the visualization (which fields are applied to the Shared Axis, Column Values, and Line Values).

该报表有 6 ,每一页都以可视方式显示了数据的某些元素。There are six Pages in this Report, each visualizing certain elements of our data.

  1. 如上所示的第一页显示了基于 总体排名 的所有州。The first page, shown above, shows all states based on Overall rank.
  2. 第二页侧重于基于 总体排名 的前十个州。The second page focuses on the top ten states based on Overall rank.
  3. 在第三页中,显示生活成本最高的前 10 个州(及相关联的数据)。For the third page, the best 10 states for cost of living (and associated data) are visualized.
  4. 第四页的重点是天气,筛选为 15 个最晴朗的州。Weather is the focus of the fourth page, filtered to the 15 sunniest states.
  5. 第五页绘制排名靠前的 15 个州的社区福利图表并将其可视化。On the fifth page, Community well-being is charted and visualized for the top 15 states.
  6. 最后一页,可视化犯罪统计数据,显示最佳(和最差)的 10 个州。Lastly, crime statistics are visualized, showing the best (and well, the last) ten states.

下面是着重于生活成本的报表页面外观。Here’s what the cost of living-focused Report page looks like.

你可以创建各种相关报表和可视化效果。There are all sorts of interesting reports and visualizations you can create.

共享工作Share your work

由于我们已经有相当完整的 Power BI Desktop 报表,我们可以在 Power BI 服务上与他人共享。Now that we have a Power BI Desktop report that’s reasonably complete, we can share it with others on the Power BI service. 有几种方法可以在 Power BI Desktop 中共享你的工作。There are a few ways to share your work in Power BI Desktop. 你可以发布到 Power BI 服务,直接从 Power BI 服务上传 .pbix 文件,或保存 .pbix 文件,然后就像任何其他文件一样发送它。You can publish to the Power BI service, you can upload the .pbix file directly from the Power BI service, or you can save the .pbix file and send it like any other file.

首先,我们来看一下直接从 Power BI Desktop 发布到 Power BI 服务。First, let's look at publishing to the Power BI service directly from Power BI Desktop. 开始功能区选择发布On the Home ribbon, select Publish.

系统可能会提示你登录到 Power BI。You may be prompted to sign in to Power BI.

当你登录并完成此发布过程后,你将看到以下对话框。When you've signed in and the publish process is complete, you see the following dialog.

当登录到 Power BI 时,你将在该服务的仪表板报表数据集区域看到你刚加载的 Power BI Desktop 文件。When you sign in to Power BI, you'll see Power BI Desktop file you just loaded in the Dashboards, Reports, and Datasets sections of the service.

另一种共享工作的方式是从 Power BI 服务内加载它。Another way to share your work is to load it from within the Power BI service. 以下链接将在浏览器中显示 Power BI 服务:The following link brings up the Power BI service in a browser:

https://app.powerbi.com

选择获取数据开始加载 Power BI Desktop 报表。Select Get Data to start the process of loading your Power BI Desktop report.

获取数据页面随即出现,你可以从中选择从何处获取你的数据。The Get Data page appears, from which you can select where to get your data from. 在此示例中,我们选择从文件获取In this case, we select Get from the Files box.

文件视图随即出现。The Files view appears. 在此示例中,我们选择 本地文件In this case, we select Local File.

选择该文件后,Power BI 将上传文件。When you select the file, Power BI uploads the file.

该文件上传后,你可以选择从 Power BI 服务左窗格中的报表选择该文件。Once the file is uploaded, you can select the file from the Reports in the left pane of the Power BI service.

Power BI 服务会显示报表的第一页。The Power BI service displays the first page of the report. 沿页面的底部,你可以选择任意选项卡以显示该报表的页面。Along the bottom of the page, you can select any tab to display that page of the report.

你可以通过从报表画布上方选择编辑报表Power BI 服务中的报表做出更改。You can make changes to a report in the Power BI service by selecting Edit Report from the top of the report canvas.

若要保存报表,请从服务中选择文件 > 另存为To save your report, select File > Save As from the service. 你可以在 Power BI 服务中,从你的报表创建各种有趣的视觉对象,并可以将该报表固定到 仪表板There are all sorts of interesting visuals you can create in the Power BI service from your report, which you can pin to a dashboard. 若要了解有关 Power BI 服务中的仪表板的详细信息,请参阅有关设计出色的仪表板提示To learn about dashboards in the Power BI service, see Tips for designing a great dashboard.

保存后,选择主页上的共享图标。Once saved, select the Share icon on the main page.

你可以在这里向你的同事发送电子邮件,与他们共享仪表板。From here, you can send an email to colleagues with whom you’d like to share the dashboard.

有关创建、共享和修改仪表板的详细信息,请参阅共享仪表板For more information about creating, sharing, and modifying dashboards, see Share a dashboard.

你可以使用 Power BI Desktop 和 Power BI 服务来制作各种与数据相关的混搭和可视化效果。There are all sorts of compelling data-related mash-ups and visualizations you can do with Power BI Desktop, and with the Power BI service. 有关详细信息,请查看下一部分。Check out the next section for more information.

诊断Diagnostics

Power BI Desktop 支持连接到诊断端口。Power BI desktop supports connecting to a diagnostics port. 诊断端口允许连接到其他工具并执行跟踪以进行诊断。The diagnostic port allows for other tools to connect to and perform traces for diagnostic purposes. 不支持对模型进行任何更改!更改模型可能会导致损坏和数据丢失。Making any changes to the model is not supported! Changes to the model may lead to corruption and data loss.

后续步骤Next steps

Power BI Desktop 可用于执行多种操作。There are all sorts of things you can do with Power BI Desktop. 有关其功能的详细信息,请参阅下列资源:For more information on its capabilities, check out the following resources: