Database Reference
In-Depth Information
Till now we have discussed how to create a simple calculated column; now it is time
to create a more advanced calculated column. Perform the following steps to do so:
1. Ensure that you are in the Grid view.
2. Click on the ProductCategory table.
3. Scroll to the right-hand side of the table and click on the top cell in the column
under Add Column .
4. Click on the formula bar and type in the following formula:
=AVERAGEX(RELATEDTABLE(DimProduct),DimProduct[DealerPrice])
5. Right-click on the newly created column and select Rename Column .
6. Change the name to Average Dealer Price .
Note
The AVERAGEX calculates the arithmetic mean of a set of values. It fol-
lows the relationship to the table that is specified in the first option, in this
case, it uses the RELATEDTABLE function that follows the default rela-
tionship to the DimProduct table.
For more information about the DAX formulas used in this example,
refer to the function reference at http://technet.microsoft.com/en-us/lib-
rary/ee634396.aspx .
Creating
calculated
measures
in
the
tabular
model
The next step is to define measures in your model. To do this, perform the following
steps:
1. Click on the FactInternetSales tab.
2. In the Measure Grid , click on the cell below the SalesAmount column.
3. Click on the Sum button to create a sum measure:
Search WWH ::




Custom Search