在模型中建立計算群組

已完成

使用計算群組必須具備 DAX 和篩選內容的基準知識。 本單元描述使用 Tabular Editor,在 Power BI 資料模型中套用計算群組。

安裝 Tabular Editor

無法在 Power BI Desktop 套用計算群組。 下載開放原始碼的 Tabular Editor 2.x 工具,以套用計算群組。

安裝表格式編輯器後,您可從 Power BI 功能區的外部工具索引標籤來存取。

External tools tab of the ribbon in Power BI desktop displaying ALM toolkit, DAX Studio, and Tabular Editor.

從功能區的 [外部工具] 索引標籤啟動 Tabular Editor,將會開啟 Tabular Editor 介面,並連線至 Power BI 資料模型。

在以下螢幕擷取畫面中,是從 Adventure Works DW 2020 Power BI 報表來啟動表格式編輯器。

Tabular Editor interface, connected to the Adventure Works DW 2020 Power BI data model.

注意

深入瞭解 Power BI Desktop 中的外部工具

建立計算群組和項目

使用 Tabular Editor 介面,在這些群組內建立計算群組和計算項目。

套用計算群組

在 Tabular Editor 中儲存計算群組,會將變更儲存至已連線的資料模型。 如要套用這些變更,您必須重新整理 Power BI Desktop 中的計算群組查詢。

Refresh the Time Intelligence query in Power BI desktop to apply the changes made in Tabular Editor.

注意

計算群組不適用於隱含量值。 必須明確定義計算群組所要評估的量值。

在視覺效果中使用計算群組

您現在可以將計算群組新增至視覺效果。 視覺化計算群組的簡單方式,是將計算群組置放於矩陣視覺效果的資料列欄位中。 這將會將計算群組套用至您在值欄位中放入的量值。

Matrix visual with calculation group in Columns field and Sales measure in values field.