開始使用 Power BI DesktopGet started with Power BI Desktop

歡迎使用 Power BI Desktop 使用者入門指南。Welcome to the getting started guide for Power BI Desktop. 此導覽說明 Power BI Desktop 的運作方式和功能,並說明如何建置穩固的資料模型和令人讚嘆的報表,來增強您的商業智慧。This tour shows you how Power BI Desktop works, what it can do, and how to build robust data models and amazing reports to amplify your business intelligence.

若要快速概要了解 Power BI Desktop 的運作方式和使用方式,只要花幾分鐘時間掃視本指南中的螢幕擷取畫面即可。For a quick overview of how Power BI Desktop works and how to use it, you can scan the screens in this guide in just a few minutes. 若要更深入了解,您可以閱讀每一個章節、執行所有步驟,然後建立您自己的 Power BI Desktop 檔案,以張貼到 Power BI 服務並與其他人共用。For a more thorough understanding, you can read through each section, perform the steps, and create your own Power BI Desktop file to post on the Power BI service and share with others.

Power B I Desktop 的螢幕擷取畫面,其中顯示範例工作項目。

您也可以觀看 Getting Started with the Power BI Desktop (開始使用 Power BI Desktop) 影片,並下載 Financial Sample (財務範例) Excel 活頁簿以跟著影片進行。You can also watch the Getting Started with the Power BI Desktop video, and download the Financial Sample Excel workbook to follow along with the video.

重要

Power BI Desktop 會每月更新及釋出,並納入客戶意見反應與新功能。Power BI Desktop is updated and released on a monthly basis, incorporating customer feedback and new features. 僅支援最新版本的 Power BI Desktop;系統會要求連絡 Power BI Desktop 支援人員的客戶升級至最新版本。Only the most recent version of Power BI Desktop is supported; customers who contact support for Power BI Desktop will be asked to upgrade to the most recent version. 您可從 Windows Store 取得最新版本的 Power BI Desktop,或作為單一可執行檔,其中包含所下載及安裝在電腦上的所有支援語言。You can get the most recent version of Power BI Desktop from the Windows Store, or as a single executable containing all supported languages that you download and install on your computer.

Power BI Desktop 的運作方式How Power BI Desktop works

使用 Power BI Desktop,您可以:With Power BI Desktop, you can:

  1. 連接到資料,包括多個資料來源。Connect to data, including multiple data sources.
  2. 透過查詢將資料成形,以建立具洞察力和吸引力的資料模型。Shape the data with queries that build insightful, compelling data models.
  3. 使用資料模型來建立視覺效果和報表。Use the data models to create visualizations and reports.
  4. 共用您的報表檔案,讓其他人能利用、據以建置並共用。Share your report files for others to leverage, build upon, and share. 您可以像任何其他檔案一樣共用 Power BI Desktop .pbix 檔案,但最有效的方法是將其上傳到 Power BI 服務You can share Power BI Desktop .pbix files like any other files, but the most compelling method is to upload them to the Power BI service.

Power BI Desktop 整合經過實證的 Microsoft 查詢引擎、資料模型化和視覺化技術。Power BI Desktop integrates proven Microsoft query engine, data modeling, and visualization technologies. 資料分析師和其他人可以建立查詢、資料連線、模型和報表的集合,並輕鬆地與其他人共用。Data analysts and others can create collections of queries, data connections, models, and reports, and easily share them with others. 透過結合 Power BI Desktop 和 Power BI 服務,就能更輕鬆地建置、共用和擴充來自資料世界的新見解,並為其建立模型。Through the combination of Power BI Desktop and the Power BI service, new insights from the world of data are easier to model, build, share, and extend.

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,稱為 Power BI 報表伺服器For data and reporting that must remain on-premises, there's a separate and specialized version of Power BI called Power BI Report Server. Power BI 報表伺服器使用個別且特製化版本的 Power BI Desktop,稱為適用於 Power BI 報表伺服器的 Power BI Desktop,這只適用於 Power BI 報表伺服器版本。Power BI Report Server uses 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 Desktop。This article describes standard Power BI Desktop.

安裝並執行 Power BI DesktopInstall and run Power BI Desktop

若要下載 Power BI Desktop,請前往 Power BI Desktop 下載頁面並選取 [免費下載]。To download Power BI Desktop, go to the Power BI Desktop download page and select Download Free. 或若要下載選項,請選取查看下載或語言選項Or for download options, select See download or language options.

您也可以從 Power BI 服務下載 Power BI Desktop。You can also download Power BI Desktop from the Power BI service. 選取頂端功能表列中的 下載 圖示,然後選取 [Power BI Desktop]。Select the Download icon in the top menu bar, and then select Power BI Desktop.

Power B I 服務的螢幕擷取畫面,其中顯示 [下載 Power B I Desktop] 選項。

在 Microsoft Store 頁面上,選取 [取得],然後遵循提示將 Power BI Desktop 安裝到您的電腦上。On the Microsoft Store page, select Get, and follow the prompts to install Power BI Desktop on your computer. 從 Windows [開始] 功能表,或從 Windows 工作列中的圖示,啟動 Power BI Desktop。Start Power BI Desktop from the Windows Start menu or from the icon in the Windows taskbar.

Power BI Desktop 第一次啟動時,會顯示 [歡迎] 畫面。The first time Power BI Desktop starts, it displays the Welcome screen.

從 [歡迎] 畫面,您可以 取得資料、查看 最近使用的來源、開啟最近使用的報表、開啟其他報表,或選取其他連結。From the Welcome screen, you can Get data, see Recent sources, open recent reports, Open other reports, or select other links. 您也可以選擇是否在啟動時一律顯示 [歡迎] 畫面。You can also choose whether to always show the Welcome screen at startup. 選取關閉圖示以關閉 [歡迎] 畫面。Select the close icon to close the Welcome screen.

Power B I Desktop 的螢幕擷取畫面,其中顯示 [歡迎] 畫面。

Power BI Desktop 的左側有三個 Power BI Desktop 檢視圖示:從上到下分別為 [報表]、[資料] 和 [關聯性]。Along the left side of Power BI Desktop are icons for the three Power BI Desktop views: Report, Data, and Relationships, from top to bottom. 目前檢視會以左側的黃色列表示,且您可以選取任何圖示來變更檢視。The current view is indicated by the yellow bar along the left, and you can change views by selecting any of the icons.

Power B I Desktop 的螢幕擷取畫面,其中顯示報表、資料和關聯性的圖示。

[報表] 檢視是預設檢視。Report view is the default view.

Power B I Desktop 的螢幕擷取畫面,其中顯示預設檢視。

Power BI Desktop 也包含 Power Query 編輯器,這會在另一個視窗中開啟。Power BI Desktop also includes the Power Query Editor, which opens in a separate window. Power Query 編輯器 中,您可以建置查詢並轉換資料,然後將調整過的資料模型載入 Power BI Desktop 以建立報表。In Power Query Editor, you can build queries and transform data, then load the refined data model into Power BI Desktop to create reports.

連線至資料Connect to data

安裝 Power BI Desktop 後,即可連線至不斷擴展的資料世界。With Power BI Desktop installed, you're ready to connect to the ever-expanding world of data. 若要查看多種可用的資料來源類型,請在 Power BI Desktop [首頁] 索引標籤中選取 [取得資料] > [更多],然後在 [取得資料] 視窗中捲動 [全部] 資料來源清單。To see the many types of data sources available, select Get Data > More in the Power BI Desktop Home tab, and in the Get Data window, scroll through the list of All data sources. 在此快速導覽中,您會連接到幾種不同的 Web 資料來源。In this quick tour, you connect to a couple of different Web data sources.

Power B I Desktop 的螢幕擷取畫面,其中顯示 [取得資料] 工具。

假設您是任職於太陽眼鏡零售商的資料分析師。Imagine you're a data analyst working for a sunglasses retailer. 您想要協助客戶鎖定在最陽光燦爛的地方銷售太陽眼鏡。You want to help your client target sunglasses sales where the sun shines most frequently. Bankrate.com 的 Best and worst states for retirement (最適合和最不適合退休生活的州) 頁面針對這個主題提供有趣的資料。The Bankrate.com Best and worst states for retirement page has interesting data on this subject.

在 Power BI Desktop [首頁] 索引標籤上,選取 [取得資料] > [Web] 以連接到 Web 資料來源。On the Power BI Desktop Home tab, select Get Data > Web to connect to a web data source.

Power B I Desktop 的螢幕擷取畫面,其中顯示 [取得資料] 工具的 [Web] 選項。

在 [從 Web] 對話方塊中,將網址 https://www.bankrate.com/retirement/best-and-worst-states-for-retirement/ 貼到 [URL] 欄位中,然後選取 [確定]。In the From Web dialog box, paste the address https://www.bankrate.com/retirement/best-and-worst-states-for-retirement/ into the URL field, and select OK.

Power B I Desktop 的螢幕擷取畫面,其中顯示 [從 Web] 對話方塊。

若出現提示,請在 [存取 Web 內容] 畫面上,選取 [連接] 以使用匿名存取。If prompted, on the Access Web Content screen, select Connect to use anonymous access.

Power BI Desktop 的查詢功能會開始運作,並連絡 Web 資源。The query functionality of Power BI Desktop goes to work and contacts the web resource. [導覽器] 視窗會傳回在該網頁找到的內容;在此案例中,其會傳回一個稱為 Ranking of best and worst states for retirement (最適合和最不適合退休生活的州排名) 的資料表及一份文件。The Navigator window returns what it found on the web page, in this case a table called Ranking of best and worst states for retirement, and a document. 您對資料表有興趣,因此請選取該資料表以查看預覽。You're interested in the table, so select it to see a preview.

此時,您可以選取 [載入] 載入資料表,或選取 [轉換資料] 在載入資料表之前進行變更。At this point you can select Load to load the table, or Transform data to make changes in the table before you load it.

Power B I Desktop 的螢幕擷取畫面,其中顯示已匯入資料的資料表。

當您選取 [轉換資料] 時,Power Query 編輯器會啟動,並顯示代表資料表的檢視。When you select Transform data, Power Query Editor launches, with a representative view of the table. [查詢設定] 窗格位於右側;您也可以在 Power Query 編輯器的 [檢視] 索引標籤中選取 [查詢設定] 來一律顯示該窗格。The Query Settings pane is on the right, or you can always show it by selecting Query Settings on the View tab of Power Query Editor.

Power B I Desktop 的螢幕擷取畫面,其中顯示包含 [查詢設定] 的 Power Query 編輯器。

如需如何連接至資料的詳細資訊,請參閱連接至 Power BI Desktop 中的資料For more information about connecting to data, see Connect to data in Power BI Desktop.

資料成形Shape data

現在已連接到資料來源,您可以調整資料以符合需求。Now that you're connected to a data source, you can adjust the data to meet your needs. 若要將資料「成形」,您可以提供逐步指示給 Power Query 編輯器,以在載入及呈現資料時調整資料。To shape data, you provide Power Query Editor with step-by-step instructions for adjusting the data while loading and presenting it. 成形不會影響原始資料來源,只會影響這個特定的資料檢視。Shaping doesn't affect the original data source, only this particular view of the data.

注意

本指南中所使用的資料表資料可能會隨著時間而改變。The table data used in this guide might change over time. 因此,您需要遵循的步驟可能會有所不同,而需要您針對如何調整步驟或結果發揮創意,這全都是學習樂趣的一部分。As such, the steps you need to follow might vary, requiring you to be creative about how you adjust steps or outcomes, which is all part of the fun of learning.

成形可能表示「轉換」資料,例如重新命名資料行或資料表、移除資料列或資料行,或是變更資料類型。Shaping can mean transforming the data, such as renaming columns or tables, removing rows or columns, or changing data types. Power Query 編輯器會將這些步驟循序擷取到 [查詢設定] 窗格中的 [套用的步驟] 下。Power Query Editor captures these steps sequentially under Applied Steps in the Query Settings pane. 每次此查詢連接到資料來源時都會執行這些步驟,如此一來,資料便會一律以您指定的方式成形。Each time this query connects to the data source, those steps are carried out, so the data is always shaped the way you specify. 當您使用 Power BI Desktop 的查詢,或任何人使用您的共用查詢 (例如在 Power BI 服務中) 時,都會進行這個程序。This process occurs when you use the query in Power BI Desktop, or when anyone uses your shared query, such as in the Power BI service.

請注意,[查詢設定] 中的 [套用的步驟] 已包含幾個步驟。Notice that the Applied Steps in Query Settings already contain a few steps. 您可以選取每個步驟,以了解其在 Power Query 編輯器中的效果。You can select each step to see its effect in the Power Query Editor. 首先,指定 Web 來源,然後在 [導覽器] 視窗中預覽資料表。First, you specified a web source, and then you previewed the table in the Navigator window. 在第三個步驟 [已變更類型] 中,Power BI 會在匯入資料時辨識整數資料,並自動將原始 Web [文字]「資料類型」變更為 [整數]。In the third step, Changed type, Power BI recognized whole number data when importing it, and automatically changed the original web Text data type to Whole numbers.

Power B I Desktop 的螢幕擷取畫面,其中顯示 [查詢設定] 窗格中的 Power Query 編輯器,以及其中三個 [套用的步驟]。

如果必須變更資料類型,請選取一或多個要變更的資料行。If you need to change a data type, select the column or columns to change. 按住 Shift 鍵選取幾個相鄰的資料行,或按 Ctrl 鍵選取不相鄰的資料行。Hold down the Shift key to select several adjacent columns, or Ctrl to select non-adjacent columns. 以滑鼠右鍵按一下資料行標頭,選取 [變更類型],然後從功能表選擇新的資料類型,或在 [首頁] 索引標籤的 [轉換] 群組中下拉 [資料類型] 旁的清單,然後選取新的資料類型。Either right-click a column header, select Change Type, and choose a new data type from the menu, or drop down the list next to Data Type in the Transform group of the Home tab, and select a new data type.

Power B I Desktop 的螢幕擷取畫面,其中顯示 [資料類型] 設定變更。

注意

Power BI Desktop 中的 Power Query 編輯器使用功能區或右鍵功能表來提供可用工作。The Power Query Editor in Power BI Desktop uses the ribbon or the right-click menus for available tasks. 您可以在功能區的 [首頁] 或 [轉換] 索引標籤中選取的大多數工作,也可以透過以滑鼠右鍵按一下項目,然後從顯示的功能表中進行選擇來加以存取。Most of the tasks you can select on the Home or Transform tabs of the ribbon are also available by right-clicking an item and choosing from the menu that appears.

您現在可以將自己的變更和轉換套用至資料,並在 [套用的步驟] 中看到結果。You can now apply your own changes and transformations to the data and see them in Applied Steps.

例如,針對太陽眼鏡銷售,您最感興趣的是天氣排名,因此您決定依 [天氣] 資料行而不是 [整體排名] 來排序資料表。For example, for sunglasses sales you're most interested in the weather ranking, so you decide to sort the table by the Weather column instead of by Overall rank. 下拉 [天氣] 標頭旁的箭號,然後選取 [遞增排序]。Drop down the arrow next to the Weather header, and select Sort ascending. 資料現在會依天氣排名排序顯示,並在 [套用的步驟] 中顯示 [已排序資料列] 步驟。The data now appears sorted by weather ranking, and the step Sorted Rows appears in Applied Steps.

Power B I Desktop 的螢幕擷取畫面,其中顯示 [套用的步驟] 中的 [已排序資料列]。

您不想要將太陽眼鏡銷售到天氣狀況最差的州,因此決定將其從資料表中移除。You're not very interested in selling sunglasses to the worst weather states, so you decide to remove them from the table. 從 [首頁] 索引標籤的 [縮減資料列] 群組,選取 [移除資料列] > [移除底端資料列]。From the Reduce Rows group of the Home tab, select Remove Rows > Remove Bottom Rows. 在 [移除底端資料列] 對話方塊中,輸入 10,然後選取 [確定]。In the Remove Bottom Rows dialog box, enter 10, and then select OK.

Power B I Desktop 的螢幕擷取畫面,其中顯示 [移除底端資料列] 對話方塊。

天氣狀況最差的最後 10 個資料列會隨即從資料表中移除,並在 [套用的步驟] 中顯示 [已移除底端資料列] 步驟。The bottom 10 worst weather rows are removed from the table, and the step Removed Bottom Rows appears in Applied Steps.

您決定資料表中有太多不需要的額外資訊,並想要移除 [可負擔性]、[犯罪]、[文化特性] 和 [福利] 資料行。You decide the table has too much extra information for your needs, and to remove the Affordability, Crime, Culture, and Wellness columns. 選取您想要移除的每個資料行標頭。Select the header of each column that you want to remove. 按住 Shift 鍵選取數個相鄰的資料行,或按 Ctrl 鍵選取不相鄰的資料行。Hold down the Shift key to select several adjacent columns, or Ctrl to select non-adjacent columns.

然後,從 [首頁] 索引標籤的 [管理資料行] 群組,選取 [移除資料行]。Then, from the Manage Columns group of the Home tab, select Remove Columns. 您也可以用滑鼠右鍵按一下其中一個選取的資料行標頭,然後從功能表選取 [移除資料行]。You can also right-click one of the selected column headers and select Remove Columns from the menu. 選取的資料行會隨即移除,並在 [套用的步驟] 中顯示 [已移除資料行] 步驟。The selected columns are removed, and the step Removed Columns appears in Applied Steps.

Power B I Desktop 的螢幕擷取畫面,其中顯示新增至 [套用的步驟] 中的 [已移除資料行]。

經過深思熟慮,您最後認為 [可負擔性] 可能與太陽眼鏡銷售相關。On second thought, Affordability might be relevant to sunglasses sales after all. 您想要取回該資料行。You'd like to get that column back. 您可以選取步驟旁的刪除圖示 X,輕鬆地復原 [套用的步驟] 中的最後一個步驟。You can easily undo the last step in the Applied Steps pane by selecting the X delete icon next to the step. 現在重做步驟,只選取您想要刪除的資料行。Now redo the step, selecting only the columns you want to delete. 為了提高彈性,您可以分步驟逐一刪除每個資料行。For more flexibility, you could delete each column as a separate step.

您可以用滑鼠右鍵按一下 [套用的步驟] 窗格中的任何步驟,然後選擇將其刪除、重新命名、上下移動順序,或是新增或刪除後面的步驟。You can right-click any step in the Applied Steps pane and choose to delete it, rename it, move it up or down in the sequence, or add or delete steps after it. 針對中繼步驟,Power BI Desktop 會在變更可能影響後續步驟並中斷查詢時警告您。For intermediate steps, Power BI Desktop will warn you if the change could affect later steps and break your query.

Power B I Desktop 的螢幕擷取畫面,其中顯示 [套用的步驟] 修改選項。

例如,如果不想再依 [天氣] 排序資料表,您可能會嘗試刪除 [已排序資料列] 步驟。For example, if you no longer wanted to sort the table by Weather, you might try to delete the Sorted Rows step. Power BI Desktop 會警告您刪除這個步驟可能會導致查詢中斷。Power BI Desktop warns you that deleting this step could cause your query to break. 在依天氣排序之後移除了最後 10 個資料列,因此如果您移除排序,則會移除不同的資料列。You removed the bottom 10 rows after you sorted by weather, so if you remove the sort, different rows will be removed. 如果您選取 [已排序資料列] 步驟,並嘗試在此時新增中繼步驟,也會收到警告。You also get a warning if you select the Sorted Rows step and try to add a new intermediate step at that point.

Power B I Desktop 的螢幕擷取畫面,其中顯示 [刪除步驟] 對話方塊。

最後,您可以將資料表標題變更為與太陽眼鏡銷售相關,而不是與退休生活相關。Finally, you change the table title to be about sunglass sales instead of retirement. 在 [查詢設定] 窗格中的 [屬性] 下,將舊標題取代為「太陽眼鏡銷售最佳的州」。Under Properties in the Query Settings pane, replace the old title with Best states for sunglass sales.

成形資料的完成查詢如下所示:The finished query for your shaped data looks like this:

Power B I Desktop 的螢幕擷取畫面,其中顯示成形資料的完成查詢。

如需如何將資料成形的詳細資訊,請參閱在 Power BI Desktop 中將資料成形及合併For more information about shaping data, see Shape and combine data in Power BI Desktop.

合併資料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 two-letter abbreviations for state codes, not the full names of the states. 若要使用該資料,您需要某種方式來建立州名及其縮寫的關聯。To use that data, you need some way to associate your state names with their abbreviations.

您很幸運。You're in luck. 有另一個公用的資料來源可執行該項工作,但資料還需要進行相當多的成形才能將其與太陽眼鏡資料表「合併」。Another public data source does just that, but the data will need a fair amount of shaping before you can combine it with your sunglass table.

若要將州縮寫資料匯入 Power Query 編輯器中,請從功能區中 [首頁] 索引標籤的 [新增查詢] 群組,選取 [新增來源] > [Web]。To import the state abbreviations data into Power Query Editor, select New Source > Web from the New Query group on the Home tab of the ribbon.

Power B I Desktop 的螢幕擷取畫面,其中顯示從 Power Query 編輯器的 [新增來源] 選取 [Web]。

在 [從 Web] 對話方塊中,輸入州縮寫網站的 URL:https://en.wikipedia.org/wiki/美國各州縮寫列表。In the From Web dialog box, enter the URL for the state abbreviations site: https://en.wikipedia.org/wiki/List_of_U.S._state_abbreviations.

在 [導覽器] 視窗中,選取 [Codes and abbreviations for U.S. states, federal district, territories, and other regions] (美國各州、聯邦行政區、領土及其他區域的代碼和縮寫) 資料表,然後選取 [確定]。In the Navigator window, select the table Codes and abbreviations for U.S. states, federal district, territories, and other regions, and then select OK. 該資料表會隨即在 Power Query 編輯器中開啟。The table opens in Power Query Editor.

除了 [Name and status of region] (區域的名稱和狀態)、[Name and status of region2] (區域2 的名稱和狀態) 和 [ANSI] 之外,移除其他所有資料行。Remove all columns except for Name and status of region, Name and status of region2, and ANSI. 若只要保留這些資料行,請按住 Ctrl 鍵並選取這些資料行。To keep only these columns, hold down Ctrl and select the columns. 然後,以滑鼠右鍵按一下其中一個資料行標頭,並選取 [移除其他資料行],或從 [首頁] 索引標籤的 [管理資料行] 群組,選取 [移除其他資料行]。Then, either right-click one of the column headers and select Remove Other Columns, or, from the Manage Columns group of the Home tab, select Remove Other Columns.

下拉 [Name and status of region2] (區域2 的名稱和狀態) 資料行標頭旁的箭號,然後選取 [篩選] > [等於]。Drop down the arrow next to the Name and status of region2 column header, and select Filters > Equals. 在 [篩選資料列] 對話方塊中,下拉 [等於] 旁的 [輸入或選取值] 欄位,然後選取 [州]。In the Filter Rows dialog box, drop down the Enter or select a value field next to equals and select State.

選取 [或],然後在第二個 [等於] 欄位旁,選取 [State ("Commonwealth")] (州 (「聯邦」))。Select Or, and next to the second equals field, select State ("Commonwealth"). 選取 [確定]。Select OK.

Power B I Desktop 的螢幕擷取畫面,其中顯示 Power Query 編輯器的 [篩選資料列] 查詢方塊。

由於移除了 Federal district (聯邦地區) 和 island (島嶼) 等額外的值,您現在會有 50 州及其官方兩個字母縮寫的清單。With extra values like Federal district and island removed, you now have a list of the 50 states and their official two-letter abbreviations. 您可以用滑鼠右鍵按一下資料行標頭,然後選取 [重新命名],將資料行重新命名得更有意義,例如 [州名]、[狀態] 和 [縮寫]。You can rename the columns to make more sense, for example State name, Status, and Abbreviation, by right-clicking the column headers and selecting Rename.

請注意,所有這些步驟都會記錄在 [查詢設定] 窗格中的 [套用的步驟] 下。Note that all of these steps are recorded under Applied Steps in the Query Settings pane.

成形的資料表現在如下所示:Your shaped table now looks like this:

Power B I Desktop 的螢幕擷取畫面,其中顯示包含 [查詢設定] 窗格中 [套用的步驟] 的 Power Query 編輯器。

在 [查詢設定] 的 [屬性] 欄位中,將資料表重新命名為「州代碼」。Retitle the table to State codes in the Properties field of Query Settings.

當 [州代碼] 資料表成形之後,您就可以將這兩個資料表「合併」成一個資料表。With the State codes table shaped, you can combine these two tables into one. 因為您現在所擁有資料表是對資料套用查詢的結果,所以也稱為「查詢」。Since the tables you now have are a result of queries you applied to the data, they're also called queries. 有兩個主要方式可結合查詢:「合併」和「附加」。There are two primary ways of combining queries: merge and append.

當您有一或多個資料行要新增至另一個查詢時,您可「合併」查詢。When you have one or more columns you'd like to add to another query, you merge the queries. 當您有其他資料列要新增至現有的查詢時,您可「附加」查詢。When you have additional rows of data you'd like to add to an existing query, you append the query.

在此案例中,您想要將 [州代碼] 查詢「合併」成 [太陽眼鏡銷售最佳的州] 查詢。In this case, you want to merge the State codes query into the Best states for sunglasses query. 若要合併查詢,請從 Power Query 編輯器左側的 [查詢] 窗格,選取並切換到 [太陽眼鏡銷售最佳的州] 查詢。To merge the queries, switch to the Best states for sunglasses query by selecting it from the Queries pane on the left side of Power Query Editor. 然後從功能區中 [首頁] 索引標籤的 [合併] 群組,選取 [合併查詢]。Then select Merge Queries from the Combine group in the Home tab of the ribbon.

在 [合併] 視窗中,下拉欄位以從其他可用的查詢選取 [州代碼]。In the Merge window, drop down the field to select State codes from the other queries available. 從每個資料表選取要比對的資料行,在此案例中為 [太陽眼鏡銷售最佳的州] 查詢中的 [州] 和 [州代碼] 查詢中的 [州名]。Select the column to match from each table, in this case State from the Best states for sunglasses query and State name from the State codes query.

若出現 [隱私權等級] 對話方塊,請選取 [略過這個檔案的隱私權等級檢查],然後選取 [儲存]。If you get a Privacy levels dialog, select Ignore privacy levels checks for this file and then select Save. 選取 [確定]。Select OK.

Power B I Desktop 的螢幕擷取畫面,其中顯示 [合併查詢] 視窗。

名為 [州代碼] 的新資料行會出現在 [太陽眼鏡銷售最佳的州] 資料表的右側。A new column called State codes appears on the right of the Best states for sunglass sales table. 其中包含已與 [太陽眼鏡銷售最佳的州] 查詢合併的 [州代碼] 查詢。It contains the state code query that you merged with the best states for sunglass sales query. 來自合併資料表的所有資料行會壓縮成 [州代碼] 資料行。All the columns from the merged table are condensed into the State codes column. 您可以「展開」合併的資料表,並只包含所需的資料行。You can expand the merged table and include only the columns you want.

Power B I Desktop 的螢幕擷取畫面,其中顯示 [州代碼] 資料行。

若要展開合併的資料表,並選取要包含哪些資料行,請選取資料行標頭中的 展開 圖示。To expand the merged table and select which columns to include, select the Expand icon in the column header. 在 [展開] 對話方塊中,只選取 [縮寫] 資料行。In the Expand dialog box, select only the Abbreviation column. 取消選取 [使用原始資料行名稱作為前置詞],然後選取 [確定]。Deselect Use original column name as prefix, and then select OK.

Power B I Desktop 的螢幕擷取畫面,其中顯示 [州代碼縮寫] 資料行。

注意

您可以嘗試如何帶入 [州代碼] 資料表。You can play around with how to bring in the State codes table. 試驗一下,如果不喜歡結果,只要從 [查詢設定] 窗格中 [套用的步驟] 清單刪除該步驟即可。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. 這是個自由重做的機會,您可以不限次數地任意執行,直到展開程序看起來是您要的方式為止。It's a free do-over, which you can do as many times as you like until the expand process looks the way you want it.

如需成形及合併資料步驟的更完整描述,請參閱在 Power BI Desktop 中將資料成形及合併For a more complete description of the shape and combine data steps, see Shape and combine data in Power BI Desktop.

您現在有合併兩個資料來源的單一查詢資料表,其中每個資料來源都已經成形以符合需求。You now have a single query table that combines two data sources, each of which has been shaped to meet your needs. 此查詢可以作為許多其他相關資料連線的基礎,例如各州的人口統計資訊、財富水平或娛樂機會。This query can serve as a basis for lots of additional, interesting data connections, such as demographics, wealth levels, or recreational opportunities in the states.

Power B I Desktop 的螢幕擷取畫面,其中顯示包含成形及合併查詢的 Power Query 編輯器。

目前,您有足夠的資料,可在 Power BI Desktop 中建立相關報表。For now, you have enough data to create an interesting report in Power BI Desktop. 由於這是一個里程碑,因此請從功能區的 [首頁] 索引標籤選取 [關閉並套用],以在 Power Query 編輯器 中套用變更,並將其載入至 Power BI Desktop 中。Since this is a milestone, apply the changes in Power Query Editor and load them into Power BI Desktop by selecting Close & Apply from the Home tab of the ribbon. 您也可以只選取 [套用],以便在 Power BI Desktop 中工作時,於 Power Query 編輯器中保持開啟查詢。You can also select just Apply to keep the query open in Power Query Editor while you work in Power BI Desktop.

Power B I Desktop 的螢幕擷取畫面,其中顯示 [關閉並套用變更] 選項。

將資料表載入至 Power BI Desktop 中之後,您可以對其進行其他變更,並重新載入模型來套用所做的任何變更。You can make more changes to a table after it is loaded into Power BI Desktop, and reload the model to apply any changes you make. 若要從 Power BI Desktop 重新開啟 Power Query 編輯器,請在 Power BI Desktop 功能區的 [首頁] 索引標籤中選取 [編輯查詢]。To reopen Power Query Editor from Power BI Desktop, select Edit Queries on the Home tab of the Power BI Desktop ribbon.

建置報表Build reports

在 Power BI Desktop [報表] 檢視中,您可以建置視覺效果和報表。In Power BI Desktop Report view, you can build visualizations and reports. [報表] 檢視有六個主要區域:The Report view has six main areas:

Power B I Desktop 的螢幕擷取畫面,其中顯示 [報表] 檢視。

  1. 頂端功能區,顯示與報表和視覺效果建立關聯的一般工作。The ribbon at the top, which displays common tasks associated with reports and visualizations.
  2. 中間的畫布區域,可在其中建立和排列視覺效果。The canvas area in the middle, where visualizations are created and arranged.
  3. 底部的頁面索引標籤區域,可讓您選取或新增報表頁面。The pages tab area at the bottom, which lets you select or add report pages.
  4. [篩選] 窗格,您可以在其中篩選資料視覺效果。The Filters pane, where you can filter data visualizations.
  5. [視覺效果] 窗格,您可以在其中新增、變更或自訂視覺效果,以及套用鑽研。The Visualizations pane, where you can add, change, or customize visualizations, and apply drillthrough.
  6. [欄位] 窗格,顯示您查詢中可用的欄位。The Fields pane, which shows the available fields in your queries. 您可以將這些欄位拖曳到畫布、[篩選] 窗格或 [視覺效果] 窗格上,以建立或修改視覺效果。You can drag these fields onto the canvas, the Filters pane, or the Visualizations pane to create or modify visualizations.

您可以選取窗格頂端的箭號,展開和摺疊 [篩選]、[視覺效果] 和 [欄位] 窗格。You can expand and collapse the Filters, Visualizations, and Fields panes by selecting the arrows at the tops of the panes. 摺疊窗格可在畫布上提供更多空間,以建置酷炫的視覺效果。Collapsing the panes provides more space on the canvas to build cool visualizations.

Power B I Desktop 的螢幕擷取畫面,其中顯示 [欄位] 窗格。

若要建立簡單的視覺效果,只要選取欄位清單中的任何欄位,或將欄位從 [欄位] 清單拖曳到畫布上即可。To create a simple visualization, just select any field in the fields list, or drag the field from the Fields list onto the canvas. 例如,將 [州] 欄位從 [太陽眼鏡銷售最佳的州] 拖曳到畫布上並查看其結果。For example, drag the State field from Best states for sunglass sales onto the canvas, and see what happens.

Power B I Desktop 的螢幕擷取畫面,其中顯示拖曳 [州] 欄位以建立地圖視覺效果。

請看!Look at that! Power BI Desktop 已辨識包含地理位置資料的 [州] 欄位,並自動建立地圖式視覺效果。Power BI Desktop recognized that the State field contained geolocation data and automatically created a map-based visualization. 視覺效果會顯示資料模型中 40 州的資料點。The visualization shows data points for the 40 states from your data model.

[視覺效果] 窗格會顯示視覺效果的相關資訊,並可讓您進行修改。The Visualizations pane shows information about the visualization and lets you modify it.

Power B I Desktop 的螢幕擷取畫面,其中顯示 [視覺效果] 窗格。

  1. 這些圖示會顯示已建立的視覺效果類型。The icons show the type of visualization created. 您可以選取不同圖示來變更所選視覺效果的類型,或選取目前未選取視覺效果的圖示來建立新視覺效果。You can change the type of a selected visualization by selecting a different icon, or create a new visualization by selecting an icon with no existing visualization selected.
  2. [視覺效果] 窗格中的 [欄位] 選項,可讓您將資料欄位拖曳到窗格中的 [圖例] 和其他欄位區域。The Fields option in the Visualization pane lets you drag data fields to Legend and other field wells in the pane.
  3. [格式] 選項可讓您將格式設定和其他控制項套用至視覺效果。The Format option lets you apply formatting and other controls to visualizations.

[欄位] 和 [格式] 區域中可用的選項取決於您所擁有視覺效果和資料類型。The options available in the Fields and Format areas depend on the type of visualization and data you have.

您想要讓地圖視覺效果只顯示天氣狀況前 10 名的州。You want your map visualization to show only the top 10 weather states. 若只要顯示前 10 名的州,請在 [篩選] 窗格中,將游標停留在 [州為 (全部)] 上方,然後展開顯示的箭號。To show only the top 10 states, in the Filters pane, hover over State is (All) and expand the arrow that appears. 在 [篩選類型] 下,下拉並選取 [前 N 個]。由於您想要顯示最低數字排名的項目,因此請在 [顯示項目] 下,選取 [底端],然後在下一個欄位中輸入 10Under Filter type, drop down and select Top N. Under Show items, select Bottom, because you want to show the items with the lowest numerical ranks, and enter 10 in the next field.

將 [天氣] 欄位從 [欄位] 窗格拖曳到 [依值] 欄位中,然後選取 [套用篩選]。Drag the Weather field from the Fields pane into the By value field, and then select Apply filter.

Power B I Desktop 的螢幕擷取畫面,其中顯示 [天氣] 篩選。

您現在只會在地圖視覺效果中看到天氣狀況前 10 名的州。You now see only the top 10 weather states in the map visualization.

選取 [視覺效果] 窗格中的 格式 圖示,選取 [標題],然後在 [標題文字] 下鍵入「天氣狀況前 10 名的州」,以重新命名視覺效果。Retitle your visualization by selecting the Format icon in the Visualization pane, selecting Title, and typing Top 10 weather states under Title text.

Power B I Desktop 的螢幕擷取畫面,其中顯示 [視覺效果] 窗格中的 [變更標題] 欄位。

若要新增視覺效果,其會顯示天氣狀況前 10 名的州名及其排名 1 到 10,請選取畫布的空白區域,然後從 [視覺效果] 窗格選取 直條圖 圖示。To add a visualization that shows the names of the top 10 weather states and their ranks from 1 to 10, select a blank area of the canvas and then select the Column chart icon from the Visualization pane. 在 [欄位] 窗格中,選取 [州] 和 [天氣]。In the Fields pane, select State and Weather. 顯示您查詢中 40 州的直條圖,從最高的數字排名排到最低,或從最差的天氣狀況排到最佳。A column chart shows the 40 states in your query, ranked from highest to lowest numerical rank, or worst to best weather.

Power B I Desktop 的螢幕擷取畫面,其中顯示直條圖視覺效果。

若要切換排名順序,讓數字 1 先出現,請選取視覺效果右上方的 [更多選項] 省略符號,然後從功能表選取 [遞增排序]。To switch the order of the ranking so that number 1 appears first, select the More options ellipsis at the upper right of the visualization, and select Sort ascending from the menu.

Power B I Desktop 的螢幕擷取畫面,其中顯示 [遞增排序] 選項。

若要將資料表限制為前 10 名的州,請套用您對地圖視覺效果所套用的相同 [最後 10 個] 篩選。To limit the table to the top 10 states, apply the same bottom 10 filter as you did for the map visualization.

以重新命名地圖視覺效果的相同方式來重新命名視覺效果。Retitle the visualization the same way as for the map visualization. 此外,在 [視覺效果] 窗格的 [格式] 區段中,將 [Y 軸] > [軸標題] 從 [天氣] 變更為「天氣排名」以更容易了解。Also in the Format section of the Visualization pane, change Y axis > Axis title from Weather to Weather ranking to make it more understandable. 然後,將 [Y 軸] 選取器切換為 [關閉],並將 [資料標籤] 切換為 [開啟]。Then, turn the Y axis selector to Off, and turn Data labels to On.

現在,天氣狀況前 10 名的州會依排名順序顯示,並提供其數字排名。Now, the top 10 weather states appear in ranked order along with their numerical rankings.

Power B I Desktop 的螢幕擷取畫面,其中顯示完成的直條圖。

您可以對 [可負擔性] 和 [整體排名] 欄位進行類似或其他視覺效果,或將數個欄位合併成一個視覺效果。You can make similar or other visualizations for the Affordability and Overall ranking fields, or combine several fields into one visualization. 您可以建立各種相關報表和視覺效果。There are all sorts of interesting reports and visualizations you can create. 這些 [資料表] 和 [折線與群組直條圖] 視覺效果會顯示天氣狀況前 10 名的州,以及其可負擔性和整體排名:These Table and Line and clustered column chart visualizations shows the top 10 weather states along with their affordability and overall rankings:

Power B I Desktop 的螢幕擷取畫面,其中顯示 [資料表] 和 [折線與群組直條圖] 視覺效果。

您可以在不同報表頁面上顯示不同視覺效果。You can show different visualizations on different report pages. 若要新增頁面,請選取頁面列上現有頁面旁的 + 符號,或在功能區的 [首頁] 索引標籤中選取 [插入] > [新增頁面]。To add a new page, select the + symbol next to the existing pages on the pages bar, or select Insert > New Page in the Home tab of the ribbon. 若要重新命名頁面,請按兩下頁面列中的頁面名稱,或以滑鼠右鍵按一下該名稱並選取 [重新命名頁面],然後鍵入新的名稱。To rename a page, double-click the page name in the pages bar, or right-click it and select Rename Page, and then type the new name. 若要移至報表的其他頁面,請從頁面列選取該頁面。To go to a different page of the report, select the page from the pages bar.

Power B I Desktop 的螢幕擷取畫面,其中顯示 [頁面] 列。

您可以從 [首頁] 索引標籤的 [插入] 群組,將文字方塊、影像和按鈕新增至報表頁面。若要設定視覺效果的格式化選項,請選取視覺效果,然後在 [視覺效果] 窗格中選取 格式 圖示。You can add text boxes, images, and buttons to your report pages from the Insert group of the Home tab. To set formatting options for visualizations, select a visualization and then select the Format icon in the Visualizations pane. 若要設定頁面大小、背景及其他頁面資訊,請選取未選取視覺效果的 格式 圖示。To configure page sizes, backgrounds, and other page information, select the Format icon with no visualization selected.

當您完成建立頁面和視覺效果時,請選取 [檔案] > [儲存] 並儲存報表。When you finish creating your pages and visualizations, select File > Save and save your report.

Power B I Desktop 的螢幕擷取畫面,其中顯示完成的報表頁面。

如需報表的詳細資訊,請參閱 Power BI Desktop 中的報表檢視For more information about reports, see Report View in Power BI Desktop.

分享您的成果Share your work

現在您有 Power BI Desktop 報表,可以與其他人共用。Now that you have a Power BI Desktop report, you can share it with others. 有幾種方式可分享您的成果。There are a few ways to share your work. 您可以像任何其他檔案一樣散發報表 .pbix 檔案、從 Power BI 服務上傳 .pbix 檔案,或直接從 Power BI Desktop 發佈到 Power BI 服務。You can distribute the report .pbix file like any other file, you can upload the .pbix file from the Power BI service, or you can publish directly from Power BI Desktop to the Power BI service. 您必須擁有 Power BI 帳戶,才能將報表發佈或上傳到 Power BI 服務。You must have a Power BI account to be able to publish or upload reports to Power BI service.

若要從 Power BI Desktop 發佈到 Power BI 服務,請從功能區的 [首頁] 索引標籤,選取 [發佈]。To publish to the Power BI service from Power BI Desktop, from the Home tab of the ribbon, select Publish.

Power B I Desktop 的螢幕擷取畫面,其中顯示完成的 [發佈] 選項。

系統可能會提示您登入 Power BI,或選取目的地。You may be prompted to sign in to Power BI, or to select a destination.

當發佈程序完成時,您會看到下列對話方塊:When the publish process is complete, you see the following dialog:

Power B I Desktop 的螢幕擷取畫面,其中顯示發佈成功訊息。

當選取連結以在 Power BI 中開啟報表時,您的報表會在 Power BI 網站的 [我的工作區] > [報表] 下開啟。When you select the link to open the report in Power BI, your report opens in your Power BI site under My workspace > Reports.

另一種分享成果的方式是從 Power BI 服務內載入它。Another way to share your work is to load it from within the Power BI service. 前往 https://app.powerbi.com 以在瀏覽器中開啟 Power BI。Go to https://app.powerbi.com to open Power BI in a browser. 在 Power BI [首頁] 頁面上,選取左下方的 [取得資料],以開始載入 Power BI Desktop 報表的程序。On your Power BI Home page, select Get data at lower left to start the process of loading your Power BI Desktop report.

Power B I Desktop 的螢幕擷取畫面,其中顯示 [取得資料] 選項。

在下一個頁面上,從 [檔案] 區段選取 [取得]。On the next page, select Get from the Files section.

Power B I Desktop 的螢幕擷取畫面,其中顯示 [取得資料] 畫面。

在下一個頁面上,選取 [本機檔案]。On the next page, select Local File. 瀏覽至您的 Power BI Desktop .pbix 檔案並加以選取,然後選取 [開啟]。Browse to and select your Power BI Desktop .pbix file, and select Open.

檔案匯入之後,您可以在 Power BI 服務左窗格中的 [我的工作區] > [報表] 下查看該檔案。After the file imports, you can see it listed under My workspace > Reports in the left pane of the Power BI service.

Power B I Desktop 的螢幕擷取畫面,其中顯示匯入至 Power B I 的檔案。

當您選取檔案時,報表的第一頁會隨即顯示。When you select the file, the first page of the report appears. 您可以從報表左側的索引標籤選取不同的頁面。You can select different pages from the tabs at the left of the report.

您可以從報表畫布頂端選取 [更多選項] > [編輯],對 Power BI 服務中的報表進行變更。You can make changes to a report in the Power BI service by selecting More options > Edit from the top of the report canvas. 若要儲存變更,請選取 [儲存複本]。To save your changes, select Save a copy.

Power B I Desktop 的螢幕擷取畫面,其中顯示 [編輯] 和 [儲存] 選項。

您可以在 Power BI 服務中,從報表建立各種有趣的視覺效果,然後釘選到「儀表板」。There are all sorts of interesting visuals you can create from your report in the Power BI service, 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. 如需有關建立、共用及修改儀表板的詳細資訊,請參閱共用儀表板For more information about creating, sharing, and modifying dashboards, see Share a dashboard.

若要共用報表或儀表板,請選取已開啟報表或儀表板頁面頂端的 [共用],或選取 [我的工作區] > [報表] 或 [我的工作區] > [儀表板] 清單中報表或儀表板名稱旁的 共用 圖示。To share a report or dashboard, select Share at the top of the open report or dashboard page, or select the Share icon next to the report or dashboard name in the My workspace > Reports or My workspace > Dashboards lists.

完成 [共用報表] 或 [共用儀表板] 畫面,以傳送電子郵件或取得連結來與其他人共用您的報表或儀表板。Complete the Share report or Share dashboard screen to send an email or get a link to share your report or dashboard with others.

Power B I Desktop 的螢幕擷取畫面,其中顯示 [共用報表] 畫面。

您可以使用 Power BI Desktop 和 Power BI 服務來製作許多與資料相關的醒目混搭與視覺效果。There are many compelling data-related mash-ups and visualizations you can do with Power BI Desktop and the Power BI service.

後續步驟Next steps

Power BI Desktop 支援連線到診斷連接埠。Power BI Desktop supports connecting to a diagnostics port. 其他工具可連線到診斷連接埠,並為診斷目的而執行追蹤。The diagnostics port allows other tools to connect to and perform traces for diagnostic purposes. 使用診斷連接埠時,不支援對模型進行任何變更。對模型進行變更可能會導致損毀以及資料遺失。When using the diagnostics port, making any changes to the model is not supported. Changes to the model may lead to corruption and data loss.

如需 Power BI Desktop 中多項功能的詳細資訊,請參閱下列資源:For more information on the many capabilities of Power BI Desktop, check out the following resources: