Microsoft PowerPivot for Excel 2010 – Data Analysis Expressions (DAX)

Formula is the reason that we use Excel; some formula are simple, e.g. “=A1+B1”, other can be complicated, e.g. DDB(cost,salvage,life,period,factor). PowerPivot also has its own formula, Data Analysis Expressions (DAX).  DAX is built on top of Excel formula but it is designed to work with multiple tables of data. It also adds new functionality that allows you to create dynamic aggregations.

You will be glad to know that most DAX functions are the same as Excel functions.  However, DAX functions always refer to a column or a table, e.g. “=[TotalSales][TotalCost]”; where [TotalSales] and [TotalCost] are 2 columns in the same table.

The biggest enhancement is DAX provides time intelligence function, which lets you use selected ranges of time frames and compare results across parallel periods.

There are 2 main types of DAX functions:

Calculated columns

Calculated column is a formula that includes functions and values, e.g. “=[Price] * 0.7”.  It is similar to the formula in Excel.


Measures are used to create dynamic aggregations for use in PivotTables which are placed into the Values area of a PivotTable. It would be evaluated for each cell within the PivotTable.  Based on the column value and row value, each cell will be calculated differently

DAX measures can be defined implicitly and explicitly.

Implicit DAX Measures

When you drag a field from PowerPivot Field List to the Values section, PowerPivot would automatically create a measure for you, e.g Sum of TotalProfit.


  • Change the Field Setting by right click on the measure and select Edit Measure.


  • Change the Custom Name to Profit by Category or change how the field to be aggregated, e.g. Average.


Implicit Measure only allows you to select simple aggregation (SUM, COUNT, AVERAGE, MIN, or MAX).  If you want anything advanced, then you must create a measure explicitly.

Explicit DAX Measures

To create a DAX measure,

  • Click anywhere on the PivotTable.
  • Select the New Measure on the PowerPivot ribbon.


  • Define the Measure Settings.


  • Click the fx button to bring up the Insert Function dialogue where you can select what formula to be used in the measure.


  • You can refer to other measures that are already established, e.g. “= CALCULATE ([Profit by Category ], DimChannel [ChannelName]=”Store”)”
  • The second portion of the formula, “DimChannel [ChannelName]=”Store”)”, is known as filter in PowerPivot which would constraint how this measure to be evaluated in the PivotTable,

Time Intelligence Functions

No matter if you are doing financial, sales, or other performance analysis, time is always a critical dimension.  You may want to compare year-to-date, same period last year, or year over year growth.  PowerPivot is much more powerful than Excel in term of time series analysis.  DAX provides a comprehensive list of time intelligence functions.  Below is a short list of what you can use:

  • FIRSTDATE (Date_Column)
  • LASTDATE (Date_Column)
  • FIRSTNONBLANK (Date_Column, Expression)
  • LASTNONBLANK (Date_Column, Expression)
  • STARTOFMONTH (Date_Column)
  • STARTOFQUARTER (Date_Column)
  • STARTOFYEAR (Date_Column [,YE_Date])
  • ENDOFMONTH (Date_Column)
  • ENDOFQUARTER (Date_Column)
  • ENDOFYEAR (Date_Column [,YE_Date])
  • PREVIOUSDAY (Date_Column)
  • PREVIOUSMONTH (Date_Column)
  • PREVIOUSYEAR (Date_Column [,YE_Date])
  • NEXTDAY (Date_Column)
  • NEXTMONTH (Date_Column)
  • NEXTQUARTER (Date_Column)
  • NEXTYEAR (Date_Column [,YE_Date])
  • DATESMTD (Date_Column)
  • DATESQTD (Date_Column)
  • DATESYTD (Date_Column [,YE_Date])
  • TOTALMTD (Expression, Date_Column [, SetFilter])
  • TOTALQTD (Expression, Date_Column [, SetFilter])
  • TOTALYTD (Expression, Date_Column [, SetFilter] [,YE_Date])
  • OPENINGBALANCEMONTH (Expression, Date_Column [,SetFilter])
  • OPENINGBALANCEQUARTER Quarter (Expression, Date_Column [,SetFilter])
  • OPENINGBALANCEYEAR (Expression, Date_Column [,SetFilter] [,YE_Date])
  • CLOSINGBALANCEMONTH (Expression, Date_Column [,SetFilter])
  • CLOSINGBALANCEQUARTER (Expression, Date_Column [,SetFilter])
  • CLOSINGBALANCEYEAR (Expression, Date_Column [,SetFilter] [,YE_Date])

The time intelligence functions also allow fiscal years having a yearend date other than Dec 31.

I hope you enjoy my blogs on PowerPivot but I cannot tell you more than 1% of what PowerPivot can do.  You must experience it yourself to truly appreciate its full potential.  Download Excel 2010, PowerPivot and sample data now.  Once you are able to trial it for couple hour, you would agree with me that PowerPivot is the biggest excitement of Excel 2010.


Andrew Chan is the owner and founder of ALG Inc.

We help you to make better and faster decisions!

Why Microsoft PowerPivot?

Microsoft Excel already has a lot of powerful features e.g. Pivot Table / Pivot Chart, Analysis ToolPak, Solver; power users can even developed their own add-in. Why do we still need PowerPivot?  Why is Microsoft so excited about PowerPivot?  What can PowerPivot deliver?

Before I answer the question, let me suggest who PowerPivot is for. PowerPivot is for advanced Excel users who need to transform enormous amount of data into meaningful information instantly.  It allows you to consolidate data from finance, human resources, operations and sales departments.  You can easily handle 10 years expenses analysis (how many records we are talking about?) and drill down to investigate different expense categories, territories or even compare the income from different industries.

Here a few things that make PowerPivot shine:

  • Row-and-column limitation in Excel – You can have more than 1 million rows of data.  If you are using 64 bit Excel and have double digits gigabytes memory, you can have tens or hundreds of millions of rows.
  • Lighting fast – It handles tens or hundreds of millions of rows around the same time as Excel handles tens or hundreds of thousands of row.  It uses the new In-Memory BI (IMBI) database and a great compression algorithm in order to significantly reduce the size of the overall data stored.
  • Data from multiple sources – You can load data from databases (Access, SQL Server, Oracle, Terradata, DB2 and Sybase), Excel, text file, OLAP Cube, reports and even data feed; virtually anything that you can think of.
  • Data Relationship – PowerPivot provides a data relationship layer that lets you integrate data from different sources so you can analyze all you data as it is from a single source, so no more VLookup!
  • Powerful new analytical capabilitiesData Analysis Expressions (DAX) is designed to work with multiple tables of data.  DAX also adds new functionality that allows you to create dynamic aggregations, making DAX formulas smart about calculating values in a PivotTable.
  • Time series calculations in pivots – there are about 40 DAX functions to handle time; e.g. Year Over Year Growth, Previous Period…etc.

I strongly encourage you to download and try both Microsoft Office 2010 and PowerPivot.  You would be as excited as me; especially the first 2 features.  See is believing!  Try to import over 10 million records into PowerPivot and you would not believe what you see.  I even repeated the same test on my 5 years old laptop which only has single core and 2GB of memory.  The result is quite encouraging; i.e. you don’t need quad core / 8GB machine to run PowerPivot.

Have fun with PowerPivot and my next blog will be discussing how you can import data into PowerPivot.

Andrew Chan is the owner and founder of ALG Inc.

We help you to make better and faster decisions!