连接到 Power BI 服务中的示例Connect to the samples in the Power BI service

本教程介绍如何:This tutorial shows you how to:

  • 导入示例内容包、将其添加到 Power BI 服务以及打开内容。Import a sample content pack, add it to the Power BI service, and open the contents. 内容包 是一种示例类型,其中,数据集与仪表板和报表捆绑在一起。A content pack is a type of sample where the dataset is bundled with a dashboard and report.
  • 在 Power BI Desktop 中打开示例 .pbix 文件。Open a sample .pbix file in Power BI Desktop.

如需更多背景信息,请参阅 Power BI 的示例数据集If you'd like more background information, see Sample datasets for Power BI. 在本文章中,你将了解这些示例的全部信息:如何获取,在何处保存,如何使用这些示例,以及每个示例所表示的一些应用场景。In that article you'll learn all about the samples: how to get them, where to save them, how to use them, and some of the stories each sample can tell.

先决条件Prerequisites

Power BI 服务和 Power BI Desktop 均支持该示例。The samples are available for the Power BI service and Power BI Desktop. 要继续学习,我们将使用零售分析示例。To follow along, we'll be using the Retail analysis sample.

本教程使用的零售分析 示例内容包包含仪表板、报表和数据集。The Retail Analysis sample content pack used in this tutorial consists of a dashboard, report, and dataset. 为了熟悉此特定内容包及其应用场景,请在开始之前查看 Power BI 的零售分析示例:体验教程To familiarize yourself with this particular content pack and its scenario, see Retail Analysis sample for Power BI: Take a tour before you begin.

Power BI 服务中的示例Samples in the Power BI service

  1. 打开并登录 Power BI 服务 (app.powerbi.com),然后打开要在其中保存此示例的工作区。Open the Power BI service (app.powerbi.com), sign in, and open the workspace where you want to save the sample.

    如果没有 Power BI Pro 许可证,可以将该示例保存到“我的工作区”。If you don't have a Power BI Pro license, you can save the sample to your My Workspace.

  2. 选择左侧导航窗格底部的获取数据Select Get Data at the bottom of the left navigation pane.

    选择“获取数据”

    如果看不到“获取数据”,请选择窗格顶部的以下图标来展开导航窗格:汉堡图标If you don't see Get Data, expand the navigation pane by selecting the following icon at the top of the pane: hamburger icon.

  3. 在随即显示的“获取数据” 页上,选择“示例” 。On the Get Data page that appears, select Samples.

  4. 依次选择“零售分析示例” 和“连接” 。Select Retail Analysis Sample, and then choose Connect.

    “连接”按钮

导入的内容是什么?What was imported?

在选择“连接”时,借助示例内容包,Power BI 会获取该内容包的副本并将其存储在云中 。With the sample content packs, when you select Connect, Power BI gets a copy of that content pack and stores it for you in the cloud. 创建内容包的人员还会在其中包含数据集、报表和仪表板,而这些正是当你选择“连接”时所获取的内容 。Because the person who created the content pack included a dataset, a report, and a dashboard, that's what you get when you select Connect.

  1. 选择“连接”后,Power BI 会创建新的仪表板并将其列在“仪表板”选项卡上 。When you select Connect, Power BI creates the new dashboard and lists it on your Dashboards tab.

    零售分析示例条目

  2. 打开“报表” 选项卡。你将在此处看到名为零售分析示例的新报表 。Open the Reports tab. Here, you'll see a new report named Retail Analysis Sample.

    零售分析示例报表条目

    查看“数据集”选项卡;这里还有一个新数据集 。Check out the Datasets tab; there's a new dataset there as well.

    零售分析示例数据集条目

浏览新内容Explore your new content

现在可以自行浏览仪表板、数据集和报表。Now explore the dashboard, dataset, and report on your own. 有多种不同方法可以导航到仪表板、报表和数据集。There are many different ways to navigate to your dashboards, reports, and datasets. 下面的过程介绍了其中一种方法。One of these ways is described in the following procedure.

  1. 导航返回到“仪表板”选项卡,然后选择“零售分析示例”仪表板以将其打开 。Navigate back to the Dashboards tab, and then select the Retail Analysis Sample dashboard to open it.

    打开仪表板,其中包含各种可视化磁贴。The dashboard opens, which has a variety of visualization tiles.

  2. 选择仪表板中的一个磁贴以打开基础报表。Select one of the tiles in the dashboard to open the underlying report. 在此示例中,我们将选择“按会计月划分的本年度销售额和去年销售额”分区图 。In this example, we'll select the area chart, This Year's Sales, Last Year's Sales by Fiscal Month.

    突出显示视觉对象的零售分析示例仪表板

    报表将打开包含所选分区图的页面;在此示例中,是报表的“地区每月销售额”页 。The report opens to the page that contains the area chart you selected; in this case, the District Monthly Sales page of the report.

    “地区每月销售额”报表页

    备注

    如果磁贴是使用 Power BI 问答创建的,则会改为打开问答页。If the tile was created by using Power BI Q&A, the Q&A page will open instead. 如果磁贴是从 Excel 固定的,则 Excel Online 将在 Power BI 内打开。If the tile was pinned from Excel, Excel Online will open inside of Power BI.

  3. 如果有人与同事共享内容包,他们通常只想共享见解,而不是提供对数据的直接访问权限。When someone shares a content pack with colleagues, they typically want to share only the insights, rather than provide direct access to the data. 在“数据集”选项卡上,你有多种选项可用于浏览数据集 。On the Datasets tab, you have several options for exploring your dataset. 但是,无法像在 Power BI Desktop 或 Excel 中一样查看数据的行和列。However, you can't view the rows and columns of your data, as you can in Power BI Desktop or Excel.

    零售分析示例数据集条目

  4. 浏览数据集的一种方法是从头开始创建你自己的可视化效果和报表。One way of exploring the dataset is by creating your own visualizations and reports from scratch. 选择图表图标Select the chart icon 图表图标 打开处于报表编辑模式的数据集。to open the dataset in report editing mode.

    全新报表

  5. 浏览数据集的另一种方法是运行快速见解Another way of exploring the dataset is to run quick insights. 选择省略号 (…),然后选择“获取快速见解” 。Select the ellipses (...), and then choose Get quick insights. 见解就绪后,选择“查看见解” 。When the insights are ready, select View insights.

    见解报表

Power BI Desktop 中的示例Samples in Power BI Desktop

首次在 Power BI Desktop 中打开示例 .pbix 文件时,它将在报表视图中显示,可在其中浏览、创建和修改可视化效果中的任何报表页数。When you first open the sample .pbix file in Power BI Desktop, it displays in Report view where you can explore, create, and modify any number of report pages with visualizations. 报表视图所提供的设计体验与 Power BI 服务中报表的编辑视图所提供的几乎相同。Report view provides almost the same design experience as a report’s Editing view in the Power BI service. 可四处移动可视化内容,进行复制粘贴、合并等。You can move visualizations around, copy and paste, merge, and so on.

与在 Power BI 服务中编辑报表不同,在 Power BI Desktop 中,还可运用查询并对数据建模以确保数据支持报表中的最佳见解。Unlike editing a report in the Power BI service, in Power BI Desktop you can also work with your queries and model your data to ensure your data supports the best insights in your reports. 无论在本地驱动器还是云中,都可在任何位置保存 Power BI Desktop 文件。You can then save your Power BI Desktop file wherever you like, whether it's to your local drive or to the cloud.

  1. 下载零售分析示例 .pbix 文件并在 Power BI Desktop 中将其打开。Download the Retail Analysis sample .pbix file and open it in Power BI Desktop.

    Power BI 报表视图中的示例

  2. 将在报表视图中打开该文件。The file opens in Report view. 请注意报表编辑器底部的四个选项卡;这些选项卡代表此报表中的四页。Notice the four tabs at the bottom of the report editor; these tabs represent the four pages in this report. 在此示例中,当前选择了“新商店”页 。For this example, the New Stores page is currently selected.

    突出显示的“新商店”选项卡.

  3. 若要深入了解报表编辑器,请参阅报表编辑器教程For a deep dive into the report editor, see Take a tour of the report editor.

报表中有哪些内容?What's in your report?

下载示例 .pbix 文件时,不仅下载了报表,还下载了基础数据集 。When you download a sample .pbix file, you've downloaded not just a report but also the underlying dataset. 打开该文件时,Power BI Desktop 会加载数据与其关联的查询和关系。When you open the file, Power BI Desktop loads the data with its associated queries and relationships. 可以查看基础数据和关系,但无法在查询编辑器中查看基础查询。You can view the underlying data and relationships, but you can't view the underlying queries in the Query Editor.

  1. 选择表图标 表图标 切换到数据视图Switch to Data view by selecting the table icon table icon.

    Desktop“数据”视图

    在数据视图中,可以检查、浏览和了解 Power BI Desktop 模型中的数据。In Data view, you can inspect, explore, and understand data in your Power BI Desktop model. 它与你在查询编辑器中查看表、列和数据的方式不同。It's different from how you view tables, columns, and data in the Query Editor. 数据视图中的数据已加载到模型中。The data in Data view is already loaded into the model.

    进行数据建模时,有时想要查看表的行和列中的实际内容而不想在报表画布上创建视觉对象。When you’re modeling your data, sometimes you want to see what's actually in the rows and columns of a table, without creating a visual on the report canvas. 特别是当你要创建度量值和计算列时,或者需要识别数据类型或数据类别时。This is especially true when you’re creating measures and calculated columns, or you need to identify a data type or data category.

  2. 通过选择以下图标切换到关系视图关系视图图标Switch to Relationships view by selecting the following icon: Relationship view icon.

    Power BI Desktop 中的关系视图

    关系视图显示模型中的所有表、列和关系。Relationship view shows all of the tables, columns, and relationships in your model. 从此处,可以查看、更改和创建关系。From here you can view, change, and create relationships.

后续步骤Next steps

可以在此环境中安全操作,因为能够选择不保存更改。This environment is a safe one to play in, because you can choose not to save your changes. 不过,如果确实保存了更改,可随时选择“获取数据” 来获取此示例的新副本。But if you do save them, you can always select Get Data for a new copy of this sample.

我们希望本教程已经演示 Power BI 仪表板、数据集、关系和报表如何能够帮助深入了解示例数据。We hope this tour has shown how Power BI dashboards, datasets, relationships, and reports can provide insights into sample data. 现在轮到你了;立即连接到你自己的数据。Now it's your turn; connect to your own data. 借助 Power BI,可以连接到各种数据源。With Power BI, you can connect to a wide variety of data sources. 若要了解详细信息,请参阅 Power BI 服务入门Power BI Desktop 入门To learn more, see Get started with the Power BI service and Get started with Power BI Desktop.

有关详细信息,请参阅:For more information, see:

更多问题?More questions? 尝试参与 Power BI 社区Try the Power BI Community