教程:在 Power BI Desktop 中调整和合并数据Tutorial: Shape and combine data in Power BI Desktop

借助 Power BI Desktop,可连接到多个不同类型的数据源,然后调整数据以满足你的需求,使你能够创建可与其他人共享的视觉对象报表。With Power BI Desktop, you can connect to many different types of data sources, then shape the data to meet your needs, enabling you to create visual reports to share with others. 调整数据意味着转换数据:重命名列或表格、将文本更改为数字、删除行、将第一行设为标题等等 。Shaping data means transforming the data: renaming columns or tables, changing text to numbers, removing rows, setting the first row as headers, and so on. 合并数据意味着连接到两个或多个数据源,根据需要调整它们,然后将其合并到有用的查询中 。Combining data means connecting to two or more data sources, shaping them as needed, then consolidating them into a useful query.

在本教程中,将了解如何:In this tutorial, you'll learn how to:

  • 使用查询编辑器调整数据。Shape data by using Query Editor.
  • 连接不同的数据源。Connect to different data sources.
  • 合并这些数据源,以及创建要在报表中使用的数据模型。Combine those data sources, and create a data model to use in reports.

本教程演示如何使用 Power BI Desktop 来调整查询,其中突出显示了最常见的任务。This tutorial demonstrates how to shape a query by using Power BI Desktop, highlighting the most common tasks. 有关此处所用查询的更多详细信息,包括如何从头开始创建查询,请参阅 Power BI Desktop 入门The query used here is described in more detail, including how to create the query from scratch, in Getting Started with Power BI Desktop.

Power BI Desktop 中的查询编辑器大量地使用右键单击菜单和“转换”功能区 。Query Editor in Power BI Desktop makes ample use of right-click menus, as well as the Transform ribbon. 大部分可在功能区选择的内容也可通过右键单击项目(如某列)并从所显示的菜单中进行选择。Most of what you can select in the 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 Query Editor, you provide step-by-step instructions for Query Editor to carry out for you to adjust the data as it loads and presents it. 原始数据源不受影响,将仅调整或整理这一特定的数据视图 。The original data source isn't 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 a column) are recorded by Query Editor. 每当此查询连接到数据源时,查询编辑器都会执行这些步骤,因此数据始终以指定的方式进行调整。Each time this query connects to the data source, Query Editor carries out those steps so that the data is always shaped the way you specify. 每当你使用查询编辑器,或任何人使用你的共享查询(如在 Power BI 服务上)时,都会出现此过程。This process occurs whenever you use Query Editor, or for anyone who uses your shared query, such as on the Power BI service. 这些步骤在“应用的步骤” 下的“查询设置” 窗格中按顺序捕获。Those steps are captured, sequentially, in the Query Settings pane, under Applied Steps. 接下来的几个段落会介绍其中的每个步骤。We’ll go through each of those steps in the next few paragraphs.

查询设置中已应用的步骤

通过 Power BI Desktop 入门退休数据,调整该数据以满足我们的需求。From Getting Started with Power BI Desktop, let's use the retirement data, which we found by connecting to a web data source, to shape that data to fit our needs. 我们将添加一个自定义列,在所有数据具有同等因素的前提下计算排名,并将此列与现有列“排名”进行比较 。We'll add a custom column to calculate rank based on all data being equal factors, and compare this column to the existing column, Rank.

  1. 从“添加列”功能区中,选择“自定义列”,这样即可添加自定义列 。From the Add Column ribbon, select Custom Column, which lets you add a custom column.

    选择自定义列

  2. 在“自定义列”窗口的“新列名称”中,输入“新排名” 。In the Custom Column window, in New column name, enter New Rank. 在“自定义列公式”中,输入以下数据 :In Custom column formula, enter the following data:

    ([Cost of living] + [Weather] + [Health care quality] + [Crime] + [Tax] + [Culture] + [Senior] + [#"Well-being"]) / 8
    
  3. 确保状态消息为“未检测到任何语法错误”,并选择“确定” 。Make sure the status message is No syntax errors have been detected, and select OK.

    “自定义列”页,未发生任何语法错误

  4. 为了保持列数据的一致性,请将新列值转换为整数。To keep column data consistent, transform the new column values to whole numbers. 要进行更改,右键单击列标题,然后选择“更改类型”>“整数” 。To change them, right-click the column header, and then select Change Type > Whole Number.

    如需选择多列,请先选择一列然后按住 Shift,再选择其他相邻列,然后右键单击列标题 。If you need to choose more than one column, select a column, hold down SHIFT, select additional adjacent columns, and then right-click a column header. 也可以使用 CTRL 键来选择不相邻的列。You can also use the CTRL key to choose non-adjacent columns.

    选择整数列数据

  5. 若要转换列数据类型,也就是将当前数据类型转换为另一种数据类型,请从“转换”功能区中选择“数据类型文本” 。To transform column data types, in which you transform the current data type to another, select Data Type Text from the Transform ribbon.

    选择数据类型文本

  6. 在“查询设置”中,“应用的步骤”列表反映应用到数据的所有调整步骤 。In Query Settings, the Applied Steps list reflects any shaping steps applied to the data. 若要删除调整过程中的步骤,请选择步骤左侧的“X” 。To remove a step from the shaping process, select the X to the left of the step.

    在下图中,“应用的步骤”列表反映了迄今为止添加的步骤 :In the following image, the Applied Steps list reflects the added steps so far:

    • :正在连接到网站。Source: Connecting to the website.

    • 导航:选择该表。Navigation: Selecting the table.

    • 已更改类型:将基于文本的数字列从“文本”更改为“整数” 。Changed Type: Changing text-based number columns from Text to Whole Number.

    • 已添加自定义:添加自定义列。Added Custom: Adding a custom column.

    • 已更改的类型 1:最后应用的步骤。Changed Type1: The last applied step.

      应用的步骤列表

调整数据Adjust data

我们需要先执行一些更改以调整数据,才可以使用此查询:Before we can work with this query, we need to make a few changes to adjust its data:

  • 通过删除列来调整排名。Adjust the rankings by removing a column.

    我们已决定“生活成本”是结果中的一个非因素 。We've decided Cost of living is a non-factor in our results. 删除此列后,我们发现数据保持不变。After removing this column, we find that the data remains unchanged.

  • 修复一些错误。Fix a few errors.

    由于我们删除了一个列,因此需要重新调整“新排名”列中的计算,其中涉及到更改公式 。Because we removed a column, we need to readjust our calculations in the New Rank column, which involves changing a formula.

  • 对数据进行排序。Sort the data.

    基于“新排名”和“排名”列对数据进行排序 。Sort the data based on the New Rank and Rank columns.

  • 替换数据。Replace the data.

    我们将重点介绍如何替换特定值以及插入“应用的步骤”的要求 。We'll highlight how to replace a specific value and the need of inserting an Applied Step.

  • 更改表名称。Change the table name.

    由于“表 0”不是表的有用描述符,因此,我们将更改其名称 。Because Table 0 isn't a useful descriptor for the table, we'll change its name.

  1. 若要删除“生活成本”列,请选中此列并依次选择功能区中的“开始”选项卡和“删除列” 。To remove the Cost of living column, select the column, choose the Home tab from the ribbon, and then select Remove Columns.

    选择“删除列”

    请注意,新排名的值未发生更改,其原因在于步骤的顺序 。Notice the New Rank values haven't changed, due to the ordering of the steps. 由于查询编辑器按顺序记录步骤,但各个步骤相互独立,因此可在序列中上下移动每个“应用的步骤” 。Because Query Editor records the steps sequentially, yet independently, of each other, you can move each Applied Step up or down in the sequence.

  2. 右键单击某个步骤。Right-click a step. 查询编辑器会提供一个菜单,让你执行以下任务:Query Editor provides a menu that lets you do the following tasks:

    • 重命名;为步骤重命名。Rename; Rename the step.
    • 删除:删除步骤。Delete: Delete the step.
    • 删除 至结尾:删除当前步骤以及所有后续步骤。Delete Until End: Remove the current step, and all subsequent steps.
    • 上移:在列表中向上移动该步骤。Move Up: Move the step up in the list.
    • 下移:在列表中向下移动该步骤。Move Down: Move the step down in the list.
  3. 将最后一步“删除列”向上移动到“已添加的自定义”步骤上方 。Move up the last step, Removed Columns, to just above the Added Custom step.

    在“应用的步骤”中向上移动步骤

  4. 选择“已添加的自定义”步骤 。Select the Added Custom step.

    请注意,数据现在显示出现“错误”,我们需要解决该错误 。Notice the data now shows Error, which we'll need to address.

    列数据中的错误结果

    可采用以下几种方法来获取每个错误的详细信息。There are a few ways to get more information about each error. 如果选择该单元格,而未单击“错误”这个词,查询编辑器将在窗口底部显示错误信息 。If you select the cell without clicking on the word Error, Query Editor displays the error information on the bottom of the window.

    查询编辑器中的错误信息

    如果直接选择“错误”这个词,则查询编辑器将在“查询设置”窗格中创建“应用的步骤”,并显示错误的相关信息 。If you select the word Error directly, Query Editor creates an Applied Step in the Query Settings pane and displays information about the error.

  5. 由于我们不需要显示有关错误的信息,因此请选择“取消” 。Because we don't need to display information about the errors, select Cancel.

  6. 若要修复错误,请选择“新排名”列,然后选择“视图”选项卡的“公式栏”复选框来显示列的数据公式 。To fix the errors, select the New Rank column, then display the column's data formula by selecting the Formula Bar checkbox from the View tab.

    选择编辑栏

  7. 删除“生活成本”参数并减少除数,方法是对公式进行如下更改 :Remove the Cost of living parameter and decrement the divisor, by changing the formula as follows:

     Table.AddColumn(#"Removed Columns", "New Rank", each ([Weather] + [Health care quality] + [Crime] + [Tax] + [Culture] + [Senior] + [#"Well-being"]) / 7)
    
  8. 选择公式框左侧的绿色复选标记,或按 Enter 。Select the green checkmark to the left of the formula box or press Enter.

查询编辑器会将数据替换为修改后的值,并且“已添加的自定义”步骤顺利完成,未出现任何错误 。Query Editor replaces the data with the revised values and the Added Custom step completes with no errors.

备注

还可以通过使用功能区或右键单击菜单来选择“删除错误”,这将删除具有错误的任意行 。You can also select Remove Errors, by using the ribbon or the right-click menu, which removes any rows that have errors. 但在本教程中,我们不希望这样操作,因为我们要保留表中的数据。However, we didn't want to do so in this tutorial because we wanted to preserve the data in the table.

  1. 基于“新排名”列对数据进行排序 。Sort the data based on the New Rank column. 首先选择最后一个应用的步骤“已更改类型 1”以显示最新数据 。First, select the last applied step, Changed Type1 to display the most recent data. 然后,选择“新排名”列标题旁边的下拉列表,并选择“升序排序” 。Then, select the drop-down located next to the New Rank column header and select Sort Ascending.

    对“新排名”列中的数据进行排序

    数据现在会根据“新排名”进行排序 。The data is now sorted according to New Rank. 但是,如果查看“排名”列,将注意到在“新排名”值为一个并列值的情况下,数据未正确排序 。However, if you look at the Rank column, you'll notice the data isn't sorted properly in cases where the New Rank value is a tie. 我们将在下一步中修复此问题。We'll fix it in the next step.

  2. 若要解决数据排序问题,请选择“新排名”列并将“公式栏”中的公式更改为以下公式 :To fix the data sorting issue, select the New Rank column and change the formula in the Formula Bar to the following formula:

     = Table.Sort(#"Changed Type1",{{"New Rank", Order.Ascending},{"Rank", Order.Ascending}})
    
  3. 选择公式框左侧的绿色复选标记,或按 Enter 。Select the green checkmark to the left of the formula box or press Enter.

    现在,行已按照“新排名”和“排名”进行排序 。The rows are now ordered in accordance with both New Rank and Rank. 此外,还可在列表的任何位置选择所应用步骤,然后继续在序列中此点处调整数据。In addition, you can select an Applied Step anywhere in the list, and continue shaping the data at that point in the sequence. 查询编辑器在当前选定的所应用步骤后直接自动插入一个新步骤 。Query Editor automatically inserts a new step directly after the currently selected Applied Step.

  4. 在“应用的步骤”中,选择自定义列前面的步骤,即步骤“已删除的列” 。In Applied Step, select the step preceding the custom column, which is the Removed Columns step. 我们将在此替换亚利桑那州的“天气”排名值 。Here we'll replace the value of the Weather ranking in Arizona. 右键单击包含亚利桑那州“天气”排名的相应单元格,然后选择“替换值” 。Right-click the appropriate cell that contains Arizona's Weather ranking, and then select Replace Values. 请注意当前选择了哪个已应用的步骤 。Note which Applied Step is currently selected.

    为列选择“替换值”

  5. 选择“插入” 。Select Insert.

    因为我们要插入步骤,所以查询编辑器提醒我们这样做的危险;后续步骤可能导致查询中断。Because we're inserting a step, Query Editor warns us about the danger of doing so; subsequent steps could cause the query to break.

    插入步骤验证

  6. 将数据值更改为“51” 。Change the data value to 51.

    查询编辑器替换亚利桑那州的数据。Query Editor replaces the data for Arizona. 创建新的所应用步骤时,查询编辑器会根据操作对其命名;本例中为“已替换值” 。When you create a new Applied Step, Query Editor names it based on the action; in this case, Replaced Value. 如果查询中具有多个名称相同的步骤,则查询编辑器将对每个后续的所应用步骤添加一个编号(按顺序)以对其进行区分 。If you have more than one step with the same name in your query, Query Editor adds a number (in sequence) to each subsequent Applied Step to differentiate between them.

  7. 选择最后一个已应用的步骤,然后选择“已排序的行” 。Select the last Applied Step, Sorted Rows.

    请注意,数据已根据亚利桑那州的新排名进行了更改。Notice the data has changed regarding Arizona's new ranking. 之所以发生此更改是因为我们在“已添加自定义”步骤前,在正确的位置插入了“已替换值”步骤 。This change occurs because we inserted the Replaced Value step in the correct location, before the Added Custom step.

  8. 最后,我们想将此表格的名称更改为描述性内容。Lastly, we want to change the name of that table to something descriptive. 在“查询设置”窗格的“属性”下,输入表的新名称,然后选择“输入” 。In the Query Settings pane, under Properties, enter the new name of the table, and then select Enter. 将此表命名为 RetirementStats 。Name this table RetirementStats.

    在“查询设置”中对表进行重命名

    在开始创建报表时,具有描述性的表格名称非常有用,特别是当连接到多个数据源,且它们均在“报表”视图的“字段”窗格中列出时 。When we start creating reports, it’s useful to have descriptive table names, especially when we connect to multiple data sources, which are listed in the Fields pane of the Report view.

    现已按所需的范围调整了数据。We’ve now shaped our data to the extent we need to. 接下来,让我们连接到其他数据源,然后合并数据。Next let’s connect to another data source, and combine data.

合并数据Combine data

有关各州的那份数据很有趣,而且适用于生成其他分析工作和查询。The 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 a 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. 若要调整数据,请执行以下步骤:TO shape the data, follow these steps:

  1. 从查询编辑器的“开始”功能区中选择“新源”>“Web” 。From the Home ribbon in Query Editor, select New Source > Web.

  2. 输入州缩写的网站地址 https://en.wikipedia.org/wiki/List_of_U.S._state_abbreviations ,然后选择“连接” 。Enter the address of the website for state abbreviations, https://en.wikipedia.org/wiki/List_of_U.S._state_abbreviations, and then select Connect.

    导航器显示网站的内容。The Navigator displays the content of the website.

    导航器页

  3. 选择“代码和缩写” 。Select Codes and abbreviations.

    提示

    要将该表的数据缩减到我们所需的范围,将需要进行大量的调整。It will take quite a bit of shaping to pare this table’s data down to what we want. 是否有更快或更容易的方法完成以下步骤?Is there a faster or easier way to accomplish the steps below? 是,我们可以创建两个表之间的关系 并基于该关系调整数据。Yes, we could create a relationship between the two tables, and shape the data based on that relationship. 以下步骤对了解表的用法仍非常有用;但关系可以帮助你快速使用来自多个表的数据。The following steps are still good to learn for working with tables; however, relationships can help you quickly use data from multiple tables.

若要对数据进行调整,请执行以下步骤:To get the data into shape, follow these steps:

  1. 删除首行。Remove the top row. 因为它是网页表格创建方式的结果,不是所需的行。Because it's a result of the way that the web page’s table was created, we don’t need it. 开始功能区中,选择减少行 > 删除行 > 删除前几行From the Home ribbon, select Reduce Rows > Remove Rows > Remove Top Rows.

    选择“删除最前几行”

    将显示删除前几行窗口,让你执行要删除几行。The Remove Top Rows window appears, letting you specify how many rows you want to remove.

    备注

    如果 Power BI 意外导入表标题作为数据表中的行,可以从“主页” 选项卡,或者从功能区的“转换” 选项卡选择“将第一行用作标题” ,以便修复表。If Power BI accidentally imports the table headers as a row in your data table, you can select Use First Row As Headers from the Home tab, or from the Transform tab in the ribbon, to fix your table.

  2. 删除底部的 26 行。Remove the bottom 26 rows. 这些行的内容是美国区域,我们不需要包括这些行。These rows are U.S. territories, which we don’t need to include. 开始功能区中,选择减少行 > 删除行 > 删除后几行From the Home ribbon, select Reduce Rows > Remove Rows > Remove Bottom Rows.

    选择“删除最后几行”

  3. 由于 RetirementStats 表没有针对华盛顿特区的信息,我们需要将其从列表中筛选去除。Because the RetirementStats table doesn't have information for Washington DC, we need to filter it from our list. 选择“区域状态”下拉箭头,然后清除“联邦特区”旁边的复选框 。Select the Region Status drop-down, then clear the checkbox beside Federal district.

    清除“联邦地区”复选框

  4. 删除一些不需要的列。Remove a few unneeded columns. 因为我们只需将每个州映射到其两个字母的官方缩写,因此可以删除下面的列:列 1、列 3、列 4,及列 6 到列 11 。Because we need only the mapping of each state to its official two-letter abbreviation, we can remove the following columns: Column1, Column3, Column4, and Column6 through Column11. 首先选择“列 1”,然后按住 Ctrl 键并选择要删除的所有其他列 。First select Column1, then hold down the CTRL key and select each of the other columns to be removed. 从功能区的“开始”选项卡上,选择“删除列”>“删除列” 。From the Home tab on the ribbon, select Remove Columns > Remove Columns.

    移除列

    备注

    此时非常适合指出,查询编辑器中已应用步骤的序列 很重要,可能会影响数据调整方式。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.

    备注

    如果将查询编辑器窗口大小重设为宽度缩小,部分功能区项会进行简缩,以充分利用可视空间。When you resize the Query Editor window to make the width smaller, some ribbon items are condensed to make the best use of visible space. 在增加查询编辑器窗口的宽度时,功能区项将展开以充分利用已增加的功能区区域。When you increase the width of the Query Editor window, the ribbon items expand to make the most use of the increased ribbon area.

  5. 重命名列和表。Rename the columns and the table. 可通过多种方法重命名列:首先,选择该列,然后从功能区的“转换”选项卡中选择“重命名”,或右键单击并选择“重命名” 。There are a few ways to rename a column: First, select the column, then either select Rename from the Transform tab on the ribbon, or right-click and select Rename. 下图具有指向这两个选项的箭头;只需任选其一。The following image has arrows pointing to both options; you only need to choose one.

    在查询编辑器中重命名列

  6. 将列重命名为“州名”和“州代码” 。Rename the columns to State Name and State Code. 若要重命名表,请在“查询设置”窗格中输入名称 。To rename the table, enter the Name in the Query Settings pane. 将此表命名为 StateCodes 。Name this table StateCodes.

合并查询Combine queries

现已按所需方式对 StateCodes 表进行了调整,接下来将这两个表或查询合并成一个表或查询。Now that we’ve shaped the StateCodes table the way we want, let’s combine these two tables, or queries, into one. 由于现有的表是针对数据应用查询后的结果,因此这些表通常称为“查询” 。Because 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 the queries. 为此,请执行以下步骤:To do so, follow these steps:

  1. 在查询编辑器的左窗格中,选择要将其他查询合并到其中的查询 。From the left pane of Query Editor, select the query into which you want the other query to merge. 在本例中选择 RetirementStats 。In this case, it's RetirementStats.

  2. 从功能区的“开始”选项卡中,选择“合并”>“合并查询” 。Select Combine > Merge Queries from the Home tab on the ribbon.

    选择“合并查询”

    系统可能会提示你设置隐私级别,以确保对数据进行合并,且不包括或不传输无需传输的数据。You may be prompted to set the privacy levels, to ensure the data is combined without including or transferring data you don't want transferred.

    随即显示“合并”窗口 。The Merge window appears. 这提示你选择想要合并到所选表中的表格,以及要用于合并的匹配列。It prompts you to select which table you'd like merged into the selected table, and the matching columns to use for the merge.

  3. 从 RetirementStats 表中选择“州”,然后选择“StateCodes”查询 。Select State from the RetirementStats table, then select the StateCodes query.

    选择了正确的匹配列后,会激活“确定”按钮 。When you select the correct matching columns, the OK button is enabled.

    “合并”窗口

  4. 选择确定Select OK.

    查询编辑器在查询的结尾创建 NewColumn 列,其中包含与现有查询合并的表(查询)的内容 。Query Editor creates a NewColumn column at the end of the query, which contains 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 column, but you can Expand the table and include whichever columns you want.

    NewColumn 列

  5. 若要扩展已合并表格,并选择要包含的列,请选择扩展图示(To expand the merged table, and select which columns to include, select the expand icon (“扩展”图标)。).

    展开窗口随即出现。The Expand window appears.

    查询中的 NewColumn

  6. 在本例中,我们只需“州代码”列 。In this case, we want only the State Code column. 选择该列,清除“使用原始列名作为前缀”,然后选择“确定” 。Select that column, clear Use original column name as prefix, and then select OK.

    如果选中了“使用原始列名作为前缀”的复选框,合并的列将命名为“NewColumn.State Code” 。If we had left the checkbox selected for Use original column name as prefix, the merged column would be named NewColumn.State Code.

    备注

    想了解如何引入 NewColumn 表?Want to explore how to bring in the 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. 你可以不限次数地任意执行,直到展开过程看起来是你要的方式为止。You can do this as many times as you like until the expand process looks the way you want it.

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

  7. 若要应用更改并关闭查询编辑器,请从“主页”功能区选项卡中选择“关闭并应用” 。To apply your changes and close Query Editor, select Close & Apply from the Home ribbon tab.

    转换后的数据集将在 Power BI Desktop 中显示,可随时用于创建报表。The transformed dataset appears in Power BI Desktop, ready to be used for creating reports.

    选择“关闭并应用”

后续步骤Next steps

有关 Power BI Desktop 及其功能的详细信息,请参阅以下资源:For more information on Power BI Desktop and its capabilities, see the following resources: