Page 720 - Excel 2013 All-in-One For Dummies
P. 720

702 Using the PowerPivot and Power View Add-Ins
 To create a calculated column for your Data Model, PowerPivot must be in Data View. (If you’re in Diagram View, you can switch back by clicking the Data View command button on the PowerPivot window’s Home tab or by clicking the Grid button in the lower right corner of the PowerPivot window.) When PowerPivot for Excel is in Data View, you can create a new calculated field by following these steps:
1. Click the tab of the data table in the PowerPivot window to which you want to add the calculated column.
2. Click the Add button on the Design tab of the PowerPivot Ribbon. PowerPivot adds a new column at the end of the current data table with
the generic field name, Add Column.
3. Type = (equal sign) to begin building your DAX expression.
PowerPivot activates its Formula bar where it inserts the equal to sign.
4. Build your DAX expression on the PowerPivot Formula bar more or less as you build an Excel formula in a cell of one of its worksheets.
To use a DAX function in the expression, click the Insert Function button on the PowerPivot Formula bar and select the function to use in the Insert Function dialog box (which is very similar to the standard Excel Insert Function dialog box except that it contains only DAX functions). To define an arithmetic or text calculation between columns in the current data table, you select the columns to use by clicking them in the data table interspersed with the appropriate operator. (See Table 1-1 in Book III, Chapter 1 for a complete list of operators.)
To select a field to use in a calculation or as an argument in a DAX function, click its field name at the top of its column to add it to the expression on the PowerPivot Formula bar. Note that PowerPivot automatically encloses all field names used in DAX expressions in a pair of square brackets as in
=[UnitPrice]*[Quantity]
where you’re building an expression in an extended price calculated column that multiplies the values in the UnitPrice field by those in the Quantity field of the active data table.
5. Click the Enter button on the PowerPivot Formula bar to complete the expression and have it calculated.






















































































   718   719   720   721   722