共用方式為


Measure 元素 (CSDL)

Measure 元素會定義可在表格式模型中用來呈現彙總或做為 KPI 的計算。 Measure 元素是以 Property 元素為基礎。

Measure 元素可能具有下列子元素 (按所列順序):

  • Documentation 元素

  • Annotation 元素

  • Kpi 元素

適用的屬性

下表描述了可在 Measure 元素上找到的屬性,以及適用於 Property 元素的所有屬性。

屬性名稱

是否必要

DefaultImage

針對 KPI 中定義的目標指出負面、中性或正面進度之影像的參考。

ContextualNameRule

定義量值之替代名稱的字串值。

DisplayFolder

量值所在之資料夾的參考 (如果有的話)。

FolderPosition

在資料夾清單中指出量值之序數位置的整數。

Hidden

True/false 值,指出量值是否應該顯示在報表中。

ReferenceName

DAX 公式可用來參考量值的名稱。

Alignment

在量值報表中指出預設對齊方式的值。

FormatString

.NET 格式字串,其中定義日期和時間值的預設格式。

IsFolderDefault

True/false 值,指出量值所代表的資料行是否為資料夾的預設欄位。

Units

字串值,其中定義用來呈現量值之值的測量單位。

Width

整數值,其中定義用來顯示量值之資料行的寬度 (以字元為單位)。

SortDirection

針對量值定義排序方向之屬性的參考。

IsRightToLeft

True/false 值,指出資料行中的值是否必須由右至左呈現。

IsSimpleMeasure

True/false 值,指出用於量值的公式是否為其中一個預設彙總 (SUM、COUNT、MIN、MAX 或 AVG),因此能夠在查詢中處理,進而提高效能。

範例

下列範例會根據 AdventureWorks 表格式模型範例顯示兩個量值。 第二個量值已經透過加入 KPI 元素,轉換成 KPI。

</Property>
<Property Name="Order_Lines_Count" Type="Int64">
  <bi:Measure Caption="Order Lines Count" ReferenceName="Order Lines Count" Width="0" IsSimpleMeasure="false" />
</Property>
<Property Name="Total_Current_Quarter_Sales_Performance" Type="Double">
  <bi:Measure Caption="Total Current Quarter Sales Performance" ReferenceName="Total Current Quarter Sales Performance" Width="0" IsSimpleMeasure="false">
    <bi:Kpi StatusGraphic="Three Signs Colored">
      <bi:KpiGoal>
        <bi:PropertyRef Name="Measures___Total_Current_Quarter_Sales_Performance_Goal_" />
      </bi:KpiGoal>
      <bi:KpiStatus>
        <bi:PropertyRef Name="Measures___Total_Current_Quarter_Sales_Performance_Status_" />
      </bi:KpiStatus>
    </bi:Kpi>
  </bi:Measure>
</Property>

範例的註解