How to create a data model in SSAS tabular
Part six of a seven-part series of blogs

The first - and most important - part of using Analysis Services (tabular mode) is to create a data model, incuding only those tables and columns you need. This lengthy blog shows you how to go about creating the perfect data model!

  1. Creating a data model in Analysis Services tabular
  2. Creating a connection to your data source
  3. Choosing tables, columns and rows to import
  4. Tidying your data model (grid/diagram view, joins, etc)
  5. Hiding tables and columns from client view
  6. Creating simple measures for our pivot table (this blog)
  7. Making changes to a model (adding tables and columns)

This blog is part of our online SSAS Tabular tutorial; we also offer lots of other Analysis Services training resources.

Posted by Andy Brown on 16 November 2015

You need a minimum screen resolution of about 700 pixels width to see our blogs. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.

Creating simple measures for our pivot table

You can take the data model that you've created and analyse it in Excel:

Analyse in Excel

Click on this tool to create a pivot table based on your data model.

 

The problem is that there's nothing to analyse!:

Pivot table

We can aggregate data by region and/or species, but there are no statistics to show!

To get round this, you need to create measures using the DAX expression language.

Much of this tutorial is given over to explaining how to write DAX expressions - for the moment, though, we'll just use a wizard to create basic statistics.

Complete the following steps to create a measure showing total quantity:

Creating measures

Click at the bottom of the column you want to analyse (step 1), then choose the statistic you want to create (step 2).

SSAS tabular will create a measure, and give it a default name:

Renaming measure

This measure gives the total quantity - you can rename it by changing the text before the colon (:).

 

Here we've renamed the measure to TotalQuantity:

Renamed measure

When you press the enter key, SSAS tabular will change the measure name.

 

You could follow a similar procedure to create a measure showing the average price for any combination of region/species:

Average price

Here we're changing the measure name to AveragePrice.

You can now choose to create a pivot table based on your data model in Excel:

Analyze in Excel

Click on this tool to create a pivot table based on your model.

 

You can now choose to display the measures you've created in the pivot table field list:

Total quantity

Here we're showing the total quantity of transactions for each region and species.

I've now shown how to create and use a full data model.  For the final part of this tutorial, I'll show how to make changes to your model if you realise you've done something wrong or omitted something.

This blog has 0 threads Add post