How to Use DAX in Excel's PowerPivot Add-In
DAX stands for Data Analysis Expression and is the name of the language that PowerPivot for Excel 2013 uses to create calculations between the columns (fields) in your Excel Data Model. Fortunately, creating a calculation with DAX is more like creating an Excel formula that uses a built-in function than it is like using a programming language such as VBA or HTML.
This similarity is underscored by the fact that all DAX expressions start with an equal sign just like all standard Excel formulas and that as soon as you start typing the first letters of the name of a DAX function you want to use in the expression you’re building, an Insert Function–like drop-down menu with all the DAX functions whose names start with those same letters appears.
And as soon as you select the DAX function you want to use from this menu, PowerPivot not only inserts the name of the DAX function on the PowerPivot Formula bar (which has the same Cancel, Enter, and Insert Function buttons as the Excel Formula bar), but also displays the complete syntax of the function, showing all the required and optional arguments of that function immediately below the Formula bar.
In addition to using DAX functions in the expressions you create for calculated columns in your Data Model, you can also create simpler expressions using the good old arithmetic operators that you know so well from your Excel formulas (+ for addition, – for subtraction, * for multiplication, / for division, and so on).
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:
Click the tab of the data table in the PowerPivot window to which you want to add the calculated column.
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.
Type = (equal sign) to begin building your DAX expression.
PowerPivot activates its Formula bar where it inserts the equal to sign.
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.
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.
Click the Enter button on the PowerPivot Formula bar to complete the expression and have it calculated.
As soon as you click the Enter button, PowerPivot performs the calculations specified by the expression you just created, returning the results to the new column. (This may take several moments depending upon the number of records in the data table.)
As soon as PowerPivot completes the calculations, the results appear in the cells of the Add Column field. You can then rename the column by double-clicking its Add Column generic name, typing in the new field name, and pressing Enter.
After creating a calculated column to your data table, you can view its DAX expression simply by clicking its field name at the top of its column in the PowerPivot Data View. If you ever need to edit its expression, you can do so simply by clicking the field name to select the entire column and then click the insertion point in the DAX expression displayed on the PowerPivot Formula bar.
If you no longer need the calculated column in the pivot table for its Data Model, you can remove it by right-clicking the column and then selecting Delete Columns on its shortcut menu. If you simply want to hide the column from the Data View, you select the Hide from Client Tools item on this shortcut menu.
Keep in mind that DAX expressions using arithmetic and logical operators follow the same order of operator precedence as in regular Excel formulas. If you ever need to alter this natural order, you must use nested parentheses in the DAX expression to alter the order as you do in Excel formulas. Just be careful when adding these parentheses this that you don’t disturb any of the square brackets that always enclose the name of any data table field referred to in the DAX expression.

Excel Glossary
active cell
The worksheet cell that contains the cell cursor. Each worksheet can have only one active cell.

Excel Glossary
AutoComplete
A feature that looks at the entries that you make in a worksheet column and automatically duplicates them in subsequent rows whenever you start a new entry that begins with the same letter or letters as an existing entry in that column.

Excel Glossary
AutoCorrect
A feature that alerts Excel 2007 to common typing errors and your own typing errors (that you specify) and tells the program how it should automatically fix them for you.

Excel Glossary
AutoFill
An Excel 2007 feature that quickly creates a series of entries based on the data you enter in one or two cells. AutoFill works with days of the week, months of the year, yearly quarters; consecutive series of numbers; and formulas. You also can add your own custom AutoFill series.

Excel Glossary
AutoFilter
A feature in Excel 2010 that enables you to temporarily hide everything in a table except the records you specifically want to view, based on criteria you specify.

Excel Glossary
Backstage view
A new feature in Excel 2010 — accessible from the green File tab — that enables you to manage files and to view the properties and stats about the workbook file you're editing.

Excel Glossary
cell
The intersection of a column and row in the worksheet.

Excel Glossary
cell address
The cell identifier, determined by its column letter(s) followed by the row number, as in cell A1, the very first cell of each worksheet at the intersection of column A and row 1.

Excel Glossary
cell cursor
The black border that surrounds the active cell in a worksheet.

Excel Glossary
clip art
Readymade drawings, illustrations, and photos offered by Microsoft for use in Microsoft Office applications.

Excel Glossary
Compatibility Checker
A utility in Excel 2007 and 2010 that you use to find potential compatibility issues if you plan to save an Excel workbook file in the older Excel 97–2003 file format.

Excel Glossary
current cell
The worksheet cell that contains the cell cursor. Each worksheet can have only one current cell.

Excel Glossary
data table
A range of cells in a worksheet in which you enter a series of possible values that Excel plugs into a formula so you can perform what-if analysis on the data.

Excel Glossary
dialog box
A rectangular window with settings and commands that appears when you click a dialog box launcher or certain other commands on the Ribbon.

Excel Glossary
dialog box launcher
A small icon in the lower-right corner of a group of command buttons on the Ribbon that you click to access a dialog box with additional related settings and commands.

Excel Glossary
function
A part of a formula that takes a number of specific arguments and then returns a single value based on those arguments.

Excel Glossary
gallery
A drop-down list of thumbnail selections that appears when you click certain command buttons on the Ribbon.

Excel Glossary
group
A section of a tab on the Excel 2007 Ribbon that organizes related command buttons into subtasks normally performed as part of the tab's larger core task. The name of a group appears at the bottom of the group, such as the Font group on the Home tab.

Excel Glossary
hyperlink
Specially formatted text that anyone can click to jump to Web sites, move to other cells or workbooks, or create an e-mail message.

Excel Glossary
keyboard shortcuts
A combination of keys that you can press to execute certain commands, as opposed to finding and clicking the commands' buttons on the Ribbon or elsewhere.

Excel Glossary
Live Preview
A feature in Excel 2007 that enables you to point to thumbnails on a drop-down gallery to see how a new font, font size, table style, or cell style would look on your selected data before you actually apply it.

Excel Glossary
macro
A series of commands or actions in Excel that are recorded and saved together in a file. You can run the macro whenever you need to perform the task.

Excel Glossary
Name box
The left-most section of the Formula bar that displays the address or name of the current cell.

Excel Glossary
pivot table
A special type of table unique to Excel 2007 that enables you to summarize large amounts of data and pivot or rearrange the table's data to display different summaries of the information it contains.

Excel Glossary
Ribbon
A new feature of the Excel 2007 interface that replaces the menus and toolbars of previous versions; appears at the top of the Excel window, just below the title bar.

Excel Glossary
ScreenTip
A small window that displays descriptive text when you point to but don't click a command on the Ribbon or other objects in a worksheet.

Excel Glossary
sheet tabs
Small tabs near the bottom of a worksheet that you click to move between the worksheets in a workbook. You can assign descriptive names to sheet tabs.

Excel Glossary
slicers
New graphic objects in Excel 2010 that enable you to quickly filter the contents of a PivotTable on more than one field.

Excel Glossary
SmartArt
A type of graphic object in Excel 2007 that gives you the ability to quickly and easily construct graphical lists and diagrams in the worksheet.

Excel Glossary
sparklines
Tiny graphs (miniature charts) that fit within a single cell in the worksheet, used to show basic trends in data.

Excel Glossary
Status bar
A horizontal bar that appears at the bottom of the Excel 2007 window and keeps you informed of Excel's current mode. In addition, you can use the Status bar to select a new worksheet view and to zoom in and out on the worksheet.

Excel Glossary
tabs
The various "pages" of Excel 2007's Ribbon interface that you click to display command buttons relating to the tab's name, such as Page Layout and Formulas.

Excel Glossary
template
A pre-designed worksheet that can be used as a basis for creating new worksheets.

Excel Glossary
WordArt
Stylized text objects that you use to add pizzazz and emphasis to headings and other text in Excel 2007 worksheets.

Excel Glossary
workbook
The basic file type that you create when you use Excel 2007. A new workbook consists of three worksheets by default.

Excel Glossary
worksheet
The main document that you work in when you enter data into cells within Excel 2007. A worksheet is stored in a workbook file.

Excel Glossary
worksheet area
The portion of an Excel 2007 worksheet in which you enter cell data and add objects such as charts and graphics.

Excel Glossary
XPS XML Paper Specification
A file format developed by Microsoft that enables people to open and print documents in XPS Reader without access to the original programs with which the documents were created (such as Excel).

Excel Glossary
Zoom slider
An object on the Status bar in Excel 2007 that enables you to increase the magnification in a worksheet or shrink it down to get an overall picture of the worksheet data.