The following example shows how to add calculated fields to the ASPxPivotGrid. Calculated fields display the result of calculated expressions. Each calculated field has a binding expression that can be a formula or aggregate function.
To supply a calculated field with data, use the ExpressionDataBinding class, and pass to the Expression property a string expression to calculate.
In this example, the DiscountAmount and PriceWithDiscount pivot grid's fields are calculated fields:
<dx:PivotGridField ID="fieldDiscountAmount" Area="DataArea"
        AreaIndex="2"
        Caption="Discount Amount">
    <DataBindingSerializable>
        <dx:ExpressionDataBinding Expression="[ExtendedPrice]*[Discount]" />
    </DataBindingSerializable>
</dx:PivotGridField>
<dx:PivotGridField ID="fieldPriceWithDiscount" Area="DataArea"
        AreaIndex="3" UnboundType="Decimal"
        FieldName="PriceWithDiscount"
        Caption="Price with Discount">
    <DataBindingSerializable>
        <dx:ExpressionDataBinding Expression="[fieldExtendedPrice] * (1 - [fieldDiscount])" />
    </DataBindingSerializable>
</dx:PivotGridField>- Default.aspx (VB: Default.aspx)
- Default.aspx.cs (VB: Default.aspx.vb)
(you will be redirected to DevExpress.com to submit your response)