Microsoft Office Tutorials and References
In Depth Information
FIguRE 2-23 The dialog box in which you add a new measure to the PowerPivot model.
Although easy to read, the DAX formula actually hides much of the power of DAX. We are
not interested in understanding now the details of how it works. Let us just take a look at it:
COUNTROWS (DISTINCT (SalesOrderDetail[ProductID]))
You can read it as “count the number of rows that are in a table containing only the distinct
values of the column ProductID of the table SalesOrderDetail”. To compute the value of this
measure, PowerPivot makes the calculation in the context defined by the PivotTable query and
provides the correct distinct count of products for each cell of the PivotTable. For example, you
can produce an interesting report like the one in Figure 2-24, which computes the number of
distinct products sold, slicing data by color.
FIguRE 2-24 Query of the distinct products.