Create Data Models in Analysis Services

Learn how to design and implement relational or tabular data models for SQL Server Analysis Services.

On This Page

Introduction

Data modeling is a fundamental aspect of building robust and performant business intelligence solutions with SQL Server Analysis Services (SSAS). A well-designed data model provides a semantic layer that simplifies data access and analysis for end-users, enabling them to derive meaningful insights from complex datasets.

This documentation guides you through the process of creating both Tabular and Multidimensional models in Analysis Services. We'll cover the tools, concepts, and best practices to help you build effective models.

Types of Models

Analysis Services supports two primary types of data models, each with its own strengths and use cases:

Tabular Models

Tabular models store data in a relational in-memory database that uses a columnar storage engine. They are designed for simplicity, ease of use, and rapid development. Tabular models are ideal for scenarios requiring fast query performance and integration with tools like Power BI, Excel PivotTables, and other Microsoft BI clients. They use DAX (Data Analysis Expressions) for calculations and queries.

Multidimensional Models

Multidimensional models organize data into cubes, which consist of measures (numeric values) and dimensions (hierarchical attributes that provide context to measures). These models are optimized for complex analytical queries and aggregations, particularly in enterprise-level data warehousing scenarios. They use MDX (Multidimensional Expressions) for queries and calculations.

Creating a Tabular Model

Creating a tabular model involves defining tables, relationships, calculations, and security roles. You can leverage several tools to achieve this.

Using Visual Studio with Analysis Services Projects Extension

Visual Studio provides a powerful integrated development environment (IDE) for building tabular models. This is the most common and recommended approach for professional development.

  1. Install the Analysis Services Projects extension: Ensure you have the latest version installed for Visual Studio.
  2. Create a new project: In Visual Studio, go to File > New > Project. Search for "Analysis Services Tabular Project" and select it.
  3. Connect to Data Sources: Right-click on "Data Sources" in the Solution Explorer and select "New Data Source." Choose your source (e.g., SQL Server, Azure SQL Database) and provide connection details.
  4. Create Tables: Right-click on "Tables" and select "New Table." You can import data from existing tables in your data source, or create tables manually.
  5. Define Relationships: Navigate to the Model Designer. Drag and drop columns between tables to create relationships, or use the "Create Relationship" dialog. Ensure cardinality and cross-filter direction are set correctly.
  6. Create Measures: In the Model Designer, select a table, and click the "New Measure" button. Write DAX expressions to define aggregations and calculations.
  7. Add Calculated Columns: Similar to measures, you can add calculated columns using DAX expressions.
  8. Implement Roles: Define security roles to control user access to data.
  9. Deploy the Model: Right-click on the project and select "Deploy" to publish your model to an Analysis Services instance.

Example DAX Measure: Total Sales

VAR TotalSalesAmount = SUM(Sales[SalesAmount])
RETURN TotalSalesAmount

Using Tabular Editor

Tabular Editor is a third-party tool that provides an alternative, script-based approach to managing and creating tabular models. It's excellent for advanced users, automation, and working directly with model JSON metadata.

Note:

While Visual Studio is great for interactive development, Tabular Editor excels in scenarios requiring automation and programmatic model manipulation.

Creating a Multidimensional Model

Multidimensional models are typically created using Visual Studio with the Analysis Services Projects extension. The process involves defining dimensions, cubes, and measures.

  1. Install the Analysis Services Projects extension: Same as for tabular models.
  2. Create a new project: In Visual Studio, create a new "Analysis Services Multidimensional Project."
  3. Define Data Sources: Create data sources to connect to your relational databases.
  4. Create Dimensions: Right-click on "Dimensions" and select "New Dimension." You can create them from existing tables or views in your data source. Configure hierarchies within dimensions.
  5. Create Cubes: Right-click on "Cubes" and select "New Cube." Associate the dimensions you created and define measures.
  6. Define Measures: Measures are aggregations of numeric data. You can define various aggregation types (SUM, COUNT, AVERAGE, etc.).
  7. Configure Cube Properties: Set properties for the cube, such as processing order, storage mode, and caching.
  8. Deploy the Model: Deploy the project to your Analysis Services instance.

Multidimensional modeling offers deep control over performance tuning and complex business logic, often used in mature data warehousing environments.

Best Practices for Data Modeling in Analysis Services

← Previous: Data Source Connections Next: Deploy and Manage Models →