教學課程:在 Power BI 報表中內嵌 Power Apps 視覺效果

適用於:Power BI Desktop Power BI 服務

在本教學課程中,您會使用Power Apps 視覺效果來建立內嵌在範例 Power BI 報表中的新應用程式。 此應用程式會與該報表中的其他視覺效果互動。

如果您沒有Power Apps訂用帳戶,請在 開始之前建立免費帳戶

在本教學課程中,您會了解如何:

  • 將 Power Apps 視覺效果新增至 Power BI 報表
  • 在 Power Apps 中工作,以建立使用 Power BI 報表數據的新應用程式
  • 在報表中檢視Power Apps視覺效果並與其互動

必要條件

建立新的應用程式

當您將Power Apps視覺效果新增至報表時,它會使用Power Apps與Power BI之間的即時數據連線來啟動Power Apps Studio。

  1. 開啟商機分析範例報告,然後選取 [即將推出的商機 ] 頁面。

  2. 從 [選項] 列選取 [編輯 ],以編輯模式開啟報表。

  3. 移動和調整部分報表磚的大小,以為新的視覺效果製作空間。

    Screenshot showing one option for making room on the report canvas.

  4. 從 [視覺效果] 窗格中,選取 [Power Apps] 圖示,然後調整視覺效果的大小以符合您所做的空間。

    Screenshot of the Visualization pane with Power Apps icon selected.

  5. 在 [欄位] 窗格中,選取 [商機>名稱]、[產品>代碼] 和 [SalesStage>銷售階段]。

    Screenshot showing the selection of the Name, Product Code, and Sales Stage fields.

  6. 在 Power Apps 視覺效果上,選取您要在其中建立應用程式的 Power Apps 環境,然後選取 [ 新建]。

    Screenshot of the Create new button.

    在 Power Apps Studio 中,您會看到已建立基本應用程式,且資源 會顯示您在 Power BI 中選取的其中一個字段。

    Screenshot showing what Power Apps looks like when it first opens.

  7. 在左窗格中,選取 [Screen1],然後將畫面的 Fill 屬性設定為 “LightBlue”(因此在報表中顯示得更好)。

    Screenshot showing the color palette used to set the Fill property.

  8. 選取 [資源庫1],將 [屬性>大小>高度] 變更為964,讓標籤元件有一些空間。

    注意

    如果您無法編輯 [高度] 字段,請嘗試先調整畫布上的視覺效果大小。 選取視覺效果並拖曳其中一個控點。 現在編輯 [ 高度] 欄位。

    Screenshot showing how to change gallery dimensions.

  9. 展開左側導覽功能表,選擇 [+ 插入],然後從控件清單中選取 [傳統>文字] 卷標。

    Screenshot of the Insert menu.

  10. 將捲標拖曳到視覺效果底部。 將 Text 屬性設定為 "Opportunity Count: " & CountRows(Gallery1.AllItems)。 畫布上的視覺效果現在會顯示數據集中總共 487 個商機。

    Screenshot of Power Apps and the visual resized.

  11. 從右上角選取 [ 儲存 ] 圖示。 以名稱 「商機應用程式」儲存應用程式。

在報表中檢視應用程式

應用程式現在可在Power BI報表中使用,而且它與其他視覺效果互動,因為它共用相同的數據源。

Screenshot showing the Power Apps visual in the Power BI report.

在 Power BI 報表中,選取 交叉分析篩選器中的 [Jan ]。 這會篩選整個報表,包括 Power Apps 視覺效果中的數據。

Screenshot showing the filtered report.

請注意,Power App 視覺效果中更新的機會計數符合報表左上角的計數。 您可以選取報表中的其他專案,以及應用程式中的數據更新。

清除資源

如果您不想使用Power Apps 視覺效果儲存商機分析範例,請刪除儀錶板、報表和語意模型。

考量與限制

如需疑難解答資訊,請參閱 Power BI 的 Power Apps 視覺效果。