連接至 Power BI Desktop 中的資料Connect to data in Power BI Desktop

透過 Power BI Desktop,您可以輕鬆地連接到持續擴展的資料世界。With Power BI Desktop you can easily connect to the ever expanding world of data. 如果您沒有 Power BI Desktop,您可以下載並加以安裝。If you don’t have Power BI Desktop, you can download and install it.

Power BI Desktop 中有「各式各樣」 的可用資料來源。There are all sorts of data sources available in Power BI Desktop. 下圖顯示如何藉由依序選取 檔案 功能區 > [取得資料] > 其他> 來連接到資料.The following image shows how to connect to data, by selecting the File ribbon, then Get Data > More.

在本例中,我們將連接到 Web 資料來源。For this example, we'll connect to a Web data source.

想像您即將退休 - 您想要住在有很多陽光、稅制合理且具備良好健康照護的地方。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 – as in, help your raincoat manufacturing client target sales where it rains a lot.

無論如何,您都可以在下列 Web 資源中找到這些主題的相關有趣資料:Either way, you find a Web resource that has interesting data about those topics, and more:

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

請選取 取得資料 >Web,然後輸入位址。You select Get Data > Web and type the address.

當您選取 [確定] 時,Power BI Desktop 的 [查詢] 功能就會開始運作。When you select OK, the Query functionality of Power BI Desktop goes to work. Power BI Desktop 會連絡 Web 資源,[導覽器] 視窗會傳回它在該網頁找到的結果。Power BI Desktop contacts the Web resource, and the Navigator window returns the results of what it found on that Web page. 在本例中,它找到一個資料表 (資料表 0) 和整份文件。In this case, it found a table (Table 0) and the overall 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.

如果我們選取 [ 編輯],即會載入資料表並啟動 [查詢編輯器]。If we select Edit, the table is loaded and Query Editor is launched. 此時會顯示 查詢設定 窗格 (若未顯示,可依序從功能區選取 檢視,然後選取 [顯示]> 查詢設定,以便顯示查詢設定 窗格)。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.

所有分數都是文字而非數字,我們需要使用數字。All those scores are text rather than numbers, and we need them to be numbers. 沒問題,只要以滑鼠右鍵按一下資料行標頭,然後選取 變更類型> [整數] 加以變更即可。No problem – just right-click the column header, and select Change Type > Whole Number to change them. 若要選擇多個資料行,請先選取一個資料行,然後按住 SHIFT 鍵並選取其他相鄰的資料行,然後以滑鼠右鍵按一下資料行標頭,即可變更所有選取的資料行。To choose more than one column, 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 鍵選擇不相鄰的資料行。Use CTRL to choose columns that are not adjacent.

在 [查詢設定] 中,[套用的步驟] 會反映任何已做的變更。In Query Settings, the Applied Steps will reflect any changes that were made. 當您對資料進行其他變更時,[查詢編輯器] 會將這些變更記錄到 [套用的步驟] 區段中,您可以視需要在此進行調整、重新瀏覽、重新排列或刪除。As you make additional changes to the data, Query Editor will record those changes in the Applied Steps section, which you can adjust, revisit, rearrange, or delete as necessary.

資料表載入後仍可進行其他變更,但目前到此為止即可。Additional changes to the table can still be made after it’s loaded, but for now this will do. 完成時,我們會從 [常用] 功能區選取 [關閉並套用],Power BI Desktop 會套用我們的變更並關閉 [查詢編輯器]。When we're done we select Close & Apply from the Home ribbon, and Power BI Desktop applies our changes and closes Query Editor.

載入資料模型之後,即可在 Power BI Desktop 的 [報表] 檢視中,將欄位拖曳到畫布上以開始建立視覺效果。With the data model loaded, in Report view in Power BI Desktop, we can begin creating visualizations by dragging fields onto the canvas.

當然,這是具有單一資料連接的簡單模型;大多數 Power BI Desktop 報表會連接到不同的資料來源、依您的需求成形並具有關聯性,以產生豐富的資料模型。Of course, this is a simple model with a single data connection; most Power BI Desktop reports will have connections to different data sources, shaped to meet your needs, with relationships that produce a rich data model.

後續步驟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:

想要提供意見反應嗎?Want to give us feedback? 太好了 – 請使用 Power BI Desktop 中的 [傳送意見反應] 功能表項目。Great – use the Send Feedback menu item in Power BI Desktop. 我們期待您的留言!We look forward to hearing from you!