Power BI Desktop 中的資料來源Data sources in Power BI Desktop

有了 Power BI Desktop,您可以從許多不同來源連接至資料。With Power BI Desktop, you can connect to data from many different sources. 如需可用資料來源的完整清單,請參閱 Power BI 資料來源For a full list of available data sources, see Power BI data sources.

您可以使用 [首頁] 功能區連接到資料。You connect to data by using the Home ribbon. 若要顯示 [最常見] 資料類型功能表,請選取 [取得資料] 按鈕標籤或向下箭號。To show the Most Common data types menu, select the Get Data button label or the down arrow.

[最常見] 資料類型功能表,Power BI Desktop 中的 [取得資料]

若要移至 [取得資料] 對話方塊,請顯示 [最常見] 資料類型功能表,然後選取 [更多]。To go to the Get Data dialog box, show the Most Common data types menu and select More. 您也可以透過直接選取 [取得資料] 圖示,叫出 [取得資料] 對話方塊 (並略過 [最常見] 功能表)。You can also bring up the Get Data dialog box (and bypass the Most Common menu) by selecting the Get Data icon directly.

[取得資料] 按鈕,Power BI Desktop

注意

Power BI 小組會持續將可用的資料來源擴充到 Power BI Desktop 與 Power BI 服務。The Power BI team is continually expanding the data sources available to Power BI Desktop and the Power BI service. 因此,您經常會看到舊版工作進行中的資料來源標示為 Beta 或「預覽」。As such, you'll often see early versions of work-in-progress data sources marked as Beta or Preview. 任何標示為「搶鮮版 (Beta)」 或「預覽」的資料來源,受到的支援與功能都有限制,而且不應該用在生產環境。Any data source marked as Beta or Preview has limited support and functionality, and it shouldn't be used in production environments. 此外,任何為 Power BI Desktop 標記為「搶鮮版 (Beta)」或「預覽」的資料來源都無法在公開推出 (GA) 前於 Power BI 服務或其他 Microsoft 服務中使用。Additionally, any data source marked as Beta or Preview for Power BI Desktop may not be available for use in the Power BI service or other Microsoft services until the data source becomes generally available (GA).

注意

Power BI Desktop 有許多資料連接器需要 Internet Explorer 10 (或更新版本) 才能進行驗證。There are many data connectors for Power BI Desktop that require Internet Explorer 10 (or newer) for authentication.

資料來源Data sources

[取得資料] 對話方塊會組織下列類別中的資料類型:The Get Data dialog box organizes data types in the following categories:

  • 全部All
  • 檔案File
  • 資料庫Database
  • Power PlatformPower Platform
  • AzureAzure
  • 線上服務Online Services
  • 其他Other

[全部] 類別包含所有類別的所有資料連線類型。The All category includes all data connection types from all categories.

檔案資料來源File data sources

[檔案] 類別提供下列資料連線:The File category provides the following data connections:

  • ExcelExcel
  • 文字/CSVText/CSV
  • XMLXML
  • JSONJSON
  • 資料夾Folder
  • PDFPDF
  • SharePoint 資料夾SharePoint folder

下圖顯示 [檔案] 的 [取得資料] 視窗。The following image shows the Get Data window for File.

檔案資料來源,[取得資料] 對話方塊,Power BI Desktop

資料庫資料來源Database data sources

[資料庫] 類別提供下列資料連線:The Database category provides the following data connections:

  • SQL Server 資料庫SQL Server database
  • Access 資料庫Access database
  • SQL Server Analysis Services 資料庫SQL Server Analysis Services database
  • Oracle 資料庫Oracle database
  • IBM Db2 資料庫IBM Db2 database
  • IBM Informix 資料庫 (搶鮮版 (Beta))IBM Informix database (Beta)
  • IBM NetezzaIBM Netezza
  • MySQL 資料庫MySQL database
  • PostgreSQL 資料庫PostgreSQL database
  • Sybase 資料庫Sybase database
  • Teradata 資料庫Teradata database
  • SAP HANA 資料庫SAP HANA database
  • SAP Business Warehouse 應用程式伺服器SAP Business Warehouse Application Server
  • SAP Business Warehouse 訊息伺服器SAP Business Warehouse Message Server
  • Amazon RedshiftAmazon Redshift
  • ImpalaImpala
  • Google BigQueryGoogle BigQuery
  • VerticaVertica
  • SnowflakeSnowflake
  • EssbaseEssbase
  • AtScale CubeAtScale cubes
  • BI 連接器BI Connector
  • Data Virtuality LDW (搶鮮版 (Beta))Data Virtuality LDW (Beta)
  • DenodoDenodo
  • DremioDremio
  • ExasolExasol
  • Indexima (搶鮮版 (Beta))Indexima (Beta)
  • InterSystems IRIS (搶鮮版 (Beta))InterSystems IRIS (Beta)
  • Jethro (搶鮮版 (Beta))Jethro (Beta)
  • KyligenceKyligence
  • Linkar PICK Style / MultiValue Databases (搶鮮版 (Beta))Linkar PICK Style / MultiValue Databases (Beta)
  • MarkLogicMarkLogic

注意

某些資料庫連接器的啟用方式為選取 [檔案] > [選項和設定] > [選項] ,然後選取 [預覽功能] 並啟用該連接器。Some database connectors require that you enable them by selecting File > Options and settings > Options then selecting Preview Features and enabling the connector. 如果您沒有看到上述連接器,但想要加以使用,請檢查您的 [預覽功能] 設定。If you don't see some of the connectors mentioned above and want to use them, check your Preview Features settings. 亦請注意,任何標示為 Beta 或「預覽」的資料來源,受到的支援和功能都有限制,不應該用在生產環境。Also note that any data source marked as Beta or Preview has limited support and functionality, and should not be used in production environments.

下圖顯示 [資料庫] 的 [取得資料] 視窗。The following image shows the Get Data window for Database.

資料庫資料來源,[取得資料] 對話方塊,Power BI Desktop

Power Platform 資料來源Power Platform data sources

Power Platform 類別提供下列資料連線:The Power Platform category provides the following data connections:

  • Power BI 資料集Power BI datasets
  • Power BI 資料流程Power BI dataflows
  • Common Data ServiceCommon Data Service
  • Power Platform 資料流程 (搶鮮版 (Beta))Power Platform dataflows (Beta)

下圖顯示 Power Platform 的 [取得資料] 視窗。The following image shows the Get Data window for Power Platform.

Power Platform 資料來源,[取得資料] 對話方塊,Power BI Desktop

Azure 資料來源Azure data sources

[Azure] 類別提供下列資料連線:The Azure category provides the following data connections:

  • Azure SQL DatabaseAzure SQL Database
  • Azure SQL 資料倉儲Azure SQL Data Warehouse
  • Azure Analysis Services 資料庫Azure Analysis Services database
  • 適用於 PostgreSQL 的 Azure 資料庫Azure Database for PostgreSQL
  • Azure Blob 儲存體Azure Blob Storage
  • Azure 表格儲存體Azure Table Storage
  • Azure Cosmos DBAzure Cosmos DB
  • Azure 資料總管 (Kusto)Azure Data Explorer (Kusto)
  • Azure Data Lake Storage Gen2Azure Data Lake Storage Gen2
  • Azure Data Lake Storage Gen1Azure Data Lake Storage Gen1
  • Azure HDInsight (HDFS)Azure HDInsight (HDFS)
  • Azure HDInsight SparkAzure HDInsight Spark
  • HDInsight 互動式查詢HDInsight Interactive Query
  • Azure 資料總管 (Kusto)Azure Data Explorer (Kusto)
  • Azure 成本管理Azure Cost Management
  • Azure 時間序列深入解析 (Beta)Azure Time Series Insights (Beta)

下圖顯示 [Azure] 的 [取得資料] 視窗。The following image shows the Get Data window for Azure.

Azure 資料來源,[取得資料] 對話方塊,Power BI Desktop

線上服務資料來源Online Services data sources

[線上服務] 類別提供下列資料連線:The Online Services category provides the following data connections:

  • SharePoint Online 清單SharePoint Online List
  • Microsoft Exchange OnlineMicrosoft Exchange Online
  • Dynamics 365 (線上)Dynamics 365 (online)
  • Dynamics NAVDynamics NAV
  • Dynamics 365 Business CentralDynamics 365 Business Central
  • Dynamics 365 Business Central (內部部署)Dynamics 365 Business Central (on-premises)
  • Microsoft Azure 使用量見解 (搶鮮版 (Beta))Microsoft Azure Consumption Insights (Beta)
  • Azure DevOps (僅限 Boards)Azure DevOps (Boards only)
  • Azure DevOps Server (僅限 Boards)Azure DevOps Server (Boards only)
  • Salesforce 物件Salesforce Objects
  • Salesforce 報表Salesforce Reports
  • Google AnalyticsGoogle Analytics
  • Adobe AnalyticsAdobe Analytics
  • appFigures (搶鮮版 (Beta))appFigures (Beta)
  • Data.World - 取得資料集 (搶鮮版 (Beta))Data.World - Get Dataset (Beta)
  • GitHub (Beta)GitHub (Beta)
  • LinkedIn Sales Navigator (搶鮮版 (Beta))LinkedIn Sales Navigator (Beta)
  • Merketo (搶鮮版 (Beta))Marketo (Beta)
  • Mixpanel (搶鮮版 (Beta))Mixpanel (Beta)
  • Planview Enterprise One - PRM (搶鮮版 (Beta))Planview Enterprise One - PRM (Beta)
  • QuickBooks Online (搶鮮版 (Beta))QuickBooks Online (Beta)
  • SmartsheetSmartsheet
  • SparkPost (搶鮮版 (Beta))SparkPost (Beta)
  • SweetIQ (搶鮮版 (Beta))SweetIQ (Beta)
  • Planview Enterprise One - CTM (搶鮮版 (Beta))Planview Enterprise One - CTM (Beta)
  • Twilio (搶鮮版 (Beta))Twilio (Beta)
  • Zendesk (搶鮮版 (Beta))Zendesk (Beta)
  • Asana (搶鮮版 (Beta))Asana (Beta)
  • Dynamics 365 Customer Insights (搶鮮版 (Beta))Dynamics 365 Customer Insights (Beta)
  • Emigo 資料來源Emigo Data Source
  • Entersoft 商務套件 (搶鮮版 (Beta))Entersoft Business Suite (Beta)
  • FactSet AnalyticsFactSet Analytics
  • Palantir FoundryPalantir Foundry
  • 企業 App StoreIndustrial App Store
  • Intune 資料倉儲 (搶鮮版 (Beta))Intune Data Warehouse (Beta)
  • Microsoft Graph 安全性 搶鮮版 (Beta)Microsoft Graph Security (Beta)
  • Power BI 的 Projectspace (搶鮮版 (Beta))Projectplace for Power BI (Beta)
  • Product Insights (搶鮮版 (Beta))Product Insights (beta)
  • Quick BaseQuick Base
  • TeamDesk (搶鮮版 (Beta))TeamDesk (Beta)
  • Webtrends 分析 (搶鮮版 (Beta))Webtrends Analytics (Beta)
  • Witivio (搶鮮版 (Beta))Witivio (Beta)
  • 工作場所分析 (搶鮮版 (Beta))Workplace Analytics (Beta)
  • Zoho Creator (搶鮮版 (Beta))Zoho Creator (Beta)

下圖顯示 [線上服務] 的 [取得資料] 視窗。The following image shows the Get Data window for Online Services.

線上服務資料來源,[取得資料] 對話方塊,Power BI Desktop

其他資料來源Other data sources

[其他] 類別提供下列資料連線:The Other category provides the following data connections:

  • WebWeb
  • SharePoint 清單SharePoint list
  • OData 摘要OData Feed
  • Active DirectoryActive Directory
  • Microsoft ExchangeMicrosoft Exchange
  • Hadoop 檔案 (HDFS)Hadoop File (HDFS)
  • SparkSpark
  • Hive LLAP (搶鮮版 (Beta))Hive LLAP (Beta)
  • R 指令碼R script
  • Python 指令碼Python script
  • ODBCODBC
  • OLE DBOLE DB
  • Acterys:模型自動化與規劃 (搶鮮版 (Beta))Acterys : Model Automation & Planning (Beta)
  • Automation Anywhere (搶鮮版 (Beta))Automation Anywhere (Beta)
  • SolverSolver
  • Cherwell (搶鮮版 (Beta))Cherwell (Beta)
  • Cognite Data Fusion (搶鮮版 (Beta))Cognite Data Fusion (Beta)
  • FHIRFHIR
  • Information Grid (搶鮮版 (Beta))Information Grid (Beta)
  • Jamf Pro (搶鮮版 (Beta))Jamf Pro (Beta)
  • MicroStrategy for Power BIMicroStrategy for Power BI
  • PaxataPaxata
  • QubolePresto (搶鮮版 (Beta))QubolePresto (Beta)
  • Roamler (搶鮮版 (Beta))Roamler (Beta)
  • Shortcuts 商業見解 (搶鮮版 (Beta))Shortcuts Business Insights (Beta)
  • Siteimprove (搶鮮版 (Beta))Siteimprove
  • SurveyMonkey 搶鮮版 (Beta)SurveyMonkey (Beta)
  • Tenforce (Smart)ListTenforce (Smart)List
  • TIBCO(R) Data Virtualization (搶鮮版 (Beta))TIBCO(R) Data Virtualization (Beta)
  • Vena (搶鮮版 (Beta))Vena (Beta)
  • Vessel 見解 (搶鮮版 (Beta))Vessel Insight (Beta)
  • Workforce Dimensions (搶鮮版 (Beta))Workforce Dimensions (Beta)
  • Zucchetti HR Infinity (搶鮮版 (Beta))Zucchetti HR Infinity (Beta)
  • 空白查詢Blank Query

下圖顯示 [其他] 的 [取得資料] 視窗。The following image shows the Get Data window for Other.

其他資料來源,[取得資料] 對話方塊,Power BI Desktop

注意

目前無法連線至使用 Azure Active Directory 保護的自訂資料來源。At this time, it's not possible to connect to custom data sources secured using Azure Active Directory.

連線到資料來源Connecting to a data source

若要連接至資料來源,請從 [取得資料] 視窗選取資料來源,然後選取 [連接] 。To connect to a data source, select the data source from the Get Data window and select Connect. 在下圖中,從 [其他] 資料連線類別選取了 [Web] 。In the following image, Web is selected from the Other data connection category.

連線到網路,[取得資料] 對話方塊,Power BI Desktop

隨即會顯示資料連線類型特有的連線視窗。A connection window is displayed, specific to the type of data connection. 如果需要認證,將提示您提供它們。If credentials are required, you’ll be prompted to provide them. 下圖顯示輸入 URL 以連接到 Web 資料來源。The following image shows a URL being entered to connect to a Web data source.

輸入 URL,[從 Web] 對話方塊,Power BI Desktop

輸入 URL 或資源連線資訊,然後選取 [確定]。Enter the URL or resource connection information, and then select OK. Power BI Desktop 會建立資料來源的連線,並在 [導覽器] 中呈現可用的資料來源。Power BI Desktop makes the connection to the data source, and it presents the available data sources in the Navigator.

[群組] 對話方塊,Power BI Desktop

若要載入資料,請從 [導覽器] 窗格底端選取 [載入] 按鈕。To load the data, select the Load button at the bottom of the Navigator pane. 若要在載入資料之前先轉換或編輯 Power Query 編輯器中的查詢,請選取 [轉換資料] 按鈕。To transform or edit the query in Power Query Editor before loading the data, select the Transform Data button.

這就是連接到 Power BI Desktop 中資料來源的全部資訊!That’s all there is to connecting to data sources in Power BI Desktop! 嘗試連接到我們持續增加的資料來源,並經常回來查看,我們隨時會增加新的來源。Try connecting to data from our growing list of data sources, and check back often - we continue to add to this list all the time.

使用 PBIDS 檔案來取得資料Using PBIDS files to get data

PBIDS 檔案是具有特定結構的 Power BI Desktop 檔案,而且它們具有 .PBIDS 副檔名,以識別它是 Power BI 資料來源檔案。PBIDS files are Power BI Desktop files that have a specific structure, and they have a .PBIDS extension to identify it is a Power BI data source file.

您可以建立 PBIDS 檔案以簡化組織中報表建立者的取得資料體驗。You can create a PBIDS file to streamline the Get Data experience for report creators in your organization. 為了讓新的報表作者能夠更輕鬆地使用 PBIDS 檔案,我們建議系統管理員為常用的連線建立這些檔案。To make it easier for a new report author to use PBIDS files, we recommend that an administrator create these files for commonly used connections.

當作者開啟 PBIDS 檔案時,Power BI Desktop 會開啟並提示使用者提供認證來進行驗證,並連線到檔案中指定的資料來源。When an author opens a PBIDS file, Power BI Desktop opens and prompts the user for credentials to authenticate and connect to the data source that's specified in the file. [瀏覽] 對話方塊隨即出現,而且使用者必須從該資料來源選取要載入至模型的資料表。The Navigation dialog box appears, and the user must select the tables from that data source to load into the model. 如果未在 PBIDS 檔案中指定的話,使用者可能也需要選取資料庫。Users may also need to select the database(s) if none was specified in the PBIDS file.

之後,使用者可以開始建置視覺效果,或選取 [最近的來源] 以將一組新的資料表載入模型中。From that point forward, the user can begin building visualizations or select Recent Sources to load a new set of tables into the model.

PBIDS 檔案目前在一個檔案中只支援一個資料來源。Currently, PBIDS files only support a single data source in one file. 指定一個以上的資料來源會導致錯誤。Specifying more than one data source results in an error.

若要建立 PBIDS 檔案,系統管理員必須指定單一連線所需的輸入。To create the PBIDS file, an administrator must specify the required inputs for a single connection. 他們也可以將連線模式指定為 DirectQuery 或 Import。They can also specify the connection mode as either DirectQuery or Import. 若檔案中缺少 mode 或為 Null,則會提示在 Power BI Desktop 中開啟檔案的使用者選取 [DirectQuery] 或 [匯入]。If mode is missing/null in the file, the user who opens the file in Power BI Desktop is prompted to select DirectQuery or Import.

PBIDS 檔案範例PBIDS file examples

此節提供一些來自常用資料來源的範例。This section provides some examples from commonly used data sources. PBIDS 檔案類型只支援 Power BI Desktop 中也支援的資料連線,但有兩個例外:Live Connect 與空白查詢。The PBIDS file type only supports data connections that are also supported in Power BI Desktop, with two exceptions: Live Connect and Blank Query.

PBIDS 檔案不包含驗證資訊與資料表和結構描述資訊。The PBIDS file doesn't include authentication information and table and schema information.

下列程式碼片段顯示數個常見的 PBIDS 檔案範例,但它們並不完整。The following code snippets show several common examples for PBIDS files, but they aren't complete or comprehensive. 針對其他資料來源,您可以參考資料來源參考 (DSR) 格式,以取得通訊協定和位址資訊 (部分機器翻譯)。For other data sources, you can refer to the Data Source Reference (DSR) format for protocol and address information.

這些範例只是為了方便起見,它們並不完整,而且不包含 DSR 格式的所有支援連接器。These examples are for convenience only, aren't meant to be comprehensive, and don't include all supported connectors in DSR format. 系統管理員或組織可以使用這些範例作為指南來建立自己的資料來源,他們可以在其中建立及支援自己的資料來源檔案。An administrator or organization can create their own data sources using these examples as guides, from which they can create and support their own data source files.

Azure ASAzure AS

{ 
    "version": "0.1", 
    "connections": [ 
    { 
        "details": { 
        "protocol": "analysis-services", 
        "address": { 
            "server": "server-here" 
        }, 
        } 
    } 
    ] 
}

資料夾Folder

{ 
  "version": "0.1", 
  "connections": [ 
    { 
      "details": { 
        "protocol": "folder", 
        "address": { 
            "path": "folder-path-here" 
        } 
      } 
    } 
  ] 
} 

ODataOData

{ 
  "version": "0.1", 
  "connections": [ 
    { 
      "details": { 
        "protocol": "odata", 
        "address": { 
            "url": "URL-here" 
        } 
      } 
    } 
  ] 
} 

SAP BWSAP BW

{ 
  "version": "0.1", 
  "connections": [ 
    { 
      "details": { 
        "protocol": "sap-bw-olap", 
        "address": { 
          "server": "server-name-here", 
          "systemNumber": "system-number-here", 
          "clientId": "client-id-here" 
        }, 
      } 
    } 
  ] 
} 

SAP HanaSAP Hana

{ 
  "version": "0.1", 
  "connections": [ 
    { 
      "details": { 
        "protocol": "sap-hana-sql", 
        "address": { 
          "server": "server-name-here:port-here" 
        }, 
      } 
    } 
  ] 
} 

SharePoint 清單SharePoint list

URL 必須指向 SharePoint 網站本身,而不是網站內的清單。The URL must point to the SharePoint site itself, not to a list within the site. 使用者會取得一個導覽器,讓他們能夠從該網站選取一或多個清單,其中每個都成為模型中的資料表。Users get a navigator that allows them to select one or more lists from that site, each of which becomes a table in the model.

{ 
  "version": "0.1", 
  "connections": [ 
    { 
      "details": { 
        "protocol": "sharepoint-list", 
        "address": { 
          "url": "URL-here" 
        }, 
       } 
    } 
  ] 
} 

SQL ServerSQL Server

{ 
  "version": "0.1", 
  "connections": [ 
    { 
      "details": { 
        "protocol": "tds", 
        "address": { 
          "server": "server-name-here", 
          "database": "db-name-here (optional) "
        } 
      }, 
      "options": {}, 
      "mode": "DirectQuery" 
    } 
  ] 
} 

文字檔Text file

{ 
  "version": "0.1", 
  "connections": [ 
    { 
      "details": { 
        "protocol": "file", 
        "address": { 
            "path": "path-here" 
        } 
      } 
    } 
  ] 
} 

WebWeb

{ 
  "version": "0.1", 
  "connections": [ 
    { 
      "details": { 
        "protocol": "http", 
        "address": { 
            "url": "URL-here" 
        } 
      } 
    } 
  ] 
} 

資料流程Dataflow

{
  "version": "0.1",
  "connections": [
    {
      "details": {
        "protocol": "powerbi-dataflows",
        "address": {
          "workspace":"workspace id (Guid)",
          "dataflow":"optional dataflow id (Guid)",
          "entity":"optional entity name"
        }
       }
    }
  ]
}

後續步驟Next steps

您可以使用 Power BI Desktop 執行各種作業。You can do all sorts of things with Power BI Desktop. 如需有關其功能的詳細資訊,請參閱下列資源:For more information on its capabilities, check out the following resources: