共用方式為


將查詢從 Dataflow Gen1 移至 Dataflow Gen2

數據流 Gen2 是新一代數據流。 不過,多年來,許多現有的數據流都是使用原始版本的數據流來建立的(現在稱為 Dataflow Gen1 ,並列在工作區中為 數據流 類型)。 本文說明如何使用導出範本功能,將數據流 Gen1 數據流匯入數據流 Gen2,以重複使用較舊的數據流 Gen1 數據流。 它也包含如何複製 Gen1 查詢,並將其貼到新的數據流 Gen2 中的資訊。

使用導出範本功能

若要使用匯出範本功能:

  1. 從 Power BI 或 Data Factory 工作區中,選取現有數據流 Gen1 旁的省略號,然後選取 [ 編輯]。

    Screenshot showing the workspace, with the dataflow menu open and edit emphasized.

  2. 在 Power Query 編輯器的 [ 首頁 ] 索引標籤中,選取 [匯出範本]。

    Screenshot showing the Power Query editor, with the Export template option emphasized.

  3. [匯出範本] 中,輸入您想要在 [名稱] 中呼叫此範本的名稱。 您可以選擇性地在 [描述] 中 新增此範本的描述

    Screenshot showing the Export template dialog box, with Contoso Sample 48 entered in Name.

  4. 選取 [ 確定 ] 以儲存範本。 範本會儲存在預設的 Downloads 資料夾中。

  5. 從 Data Factory 工作區中,選取 [ 新增],然後選取 [數據流 Gen2]。

    Screenshot with the New menu opened with Dataflow Gen2 emphasized.

  6. 從 Power Query 編輯器的目前檢視窗格中,選取 [從 Power Query 樣本匯入]。

    Screenshot showing the current view with Import from a Power Query template emphasized.

  7. 在 [ 開啟 ] 對話框中,流覽至您的預設 [下載] 資料夾,然後選取您在先前步驟中儲存的 .pqt 檔案。 選取 [開啟]。

  8. 範本接著會匯入至您的數據流 Gen2。 此時可能需要輸入認證。 如果是,請選取 [ 設定連線 ],然後輸入您的認證。 然後選取 [連線]。

    Screenshot showing the Power Query editor with Configure connection emphasized.

您的數據流 Gen1 現在已匯入至 Dataflow Gen2。

複製並貼上現有的數據流 Gen1 查詢

若要複製現有的資料串流 Gen1 查詢:

  1. 從 Power BI 或 Data Factory 工作區中,選取現有數據流 Gen1 旁的省略號,然後選取 [ 編輯]。

    Screenshot showing the workspace where you choose to edit the dataflow.

  2. 在 Power Query 中,選取您想要複製的查詢或查詢。 如果您想要複製多個查詢或資料夾(Power Query 中稱為 群組 ),請在選取要複製的查詢或資料夾時選取 Ctrl 。 然後選取 Ctrl+C 或以滑鼠右鍵按下選取範圍,然後選取 [ 複製]。

    Screenshot showing the Power Query workspace with the Contoso Financial Sample query selected and the copy option emphasized.

  3. 開啟現有的數據流 Gen2,或在 Data Factory 中建立新的數據流 Gen2。 若要建立新的數據流,請開啟現有的工作流程,然後選取 [新增>數據流 Gen2]。

    Screenshot showing the New menu opened with Dataflow Gen2 emphasized.

  4. 在 Power Query 編輯器中,選取 [取得數據>空白查詢]。

    Screenshot showing the Get data menu opened with Blank query emphasized.

  5. 在 [ 空白查詢 ] 對話框中,選取 [ 下一步]。

  6. 在 Power Query 編輯器的 [ 查詢 ] 窗格中選取 ,然後選取 Ctrl+V 以貼上查詢。

  7. 您可能需要新增認證,才能使用貼上的查詢。 Credentials are required to connect to the Web source.如果出現訊息,請選取 [設定連線],然後輸入您的認證。

    Screenshot showing the credentials error message and configure credentials button.

  8. 選取 [連線],以連線到您的數據。

  9. 聯機到數據之後,以滑鼠右鍵按鍵按下初始空白查詢,然後選取 [ 刪除 ] 以移除空白查詢。

    Screenshot showing the blank query selected, with emphasis on the delete option in the query's menu.