Create a formula column in a Data view
In a Data View, you can create a formula column that displays the result of a calculation that was performed on other data in a data source.
To create a formula column
In Design view, right-click the Data View, point to Insert on the shortcut menu, and then click Column to the Right.
Place the insertion point inside a cell in the new column, right-click inside the cell, and then click Insert Formula on the shortcut menu.
In the Insert Formula dialog box, under Select a field to insert, double-click the field that you want to insert in the expression. To insert the full path of the field, hold down CTRL while you double-click the field.
In the Edit the XPath expression box, position the insertion point immediately after the field name, and then press SPACEBAR. The IntelliSense list of XPath operators appears. IntelliSense for XPath helps you by providing a list of available fields or functions that are valid in the context of the expression.
For detailed information about creating XPath expressions, see the XPath Reference in the MSDN library.
In the IntelliSense list of operators, double-click the operator that you want.
An IntelliSense list of available fields appears.
In the list of available fields, double-click the field that you want.At the bottom of the Insert Formula dialog box, in the Preview area, you can see a preview of the results of the data in the formula column as you build the expression in the Edit the XPath expression box.
Click OK twice.
A new formula column appears in the Data View. By default, the column header is the expression that you created in the Edit the XPath expression box in the XPath Expression Builder.
To replace the default header, select the column header and then type the text that you want.