Create a Model in Azure Analysis Services
This article guides you through the process of creating a new tabular model in Azure Analysis Services using Visual Studio with the Analysis Services projects extension.
Prerequisites
- An Azure subscription.
- An Azure Analysis Services server instance.
- Visual Studio 2019 or later installed with the SQL Server Data Tools (SSDT) or Analysis Services projects extension.
Steps to Create a Model
1. Create a New Project
- Open Visual Studio.
- Go to File > New > Project.
- In the Create a new project dialog, search for "Analysis Services".
- Select the Tabular Project template and click Next.
- In the Configure your new project dialog, enter a Project name (e.g.,
AdventureWorksTabular) and a Location. - Click Create.
2. Connect to the Data Source
You'll now be prompted to specify the data source for your model. You can connect to various sources like SQL Server, Azure SQL Database, Oracle, etc.
- In the Table model designer dialog, select a Data source type (e.g.,
Microsoft SQL Server). - Enter the Server name and Database name.
- Choose an appropriate Authentication method.
- Click OK.
Note: Ensure that your Analysis Services server has network connectivity to your data source. You might need to configure firewalls or virtual networks.
3. Select Tables and Columns
After connecting to the data source, you can select the tables and columns you want to include in your model.
- The Select Tables dialog will appear.
- Check the boxes next to the tables you want to import.
- You can also select specific columns from each table by clicking the table name and then selecting/deselecting columns.
- Click OK.
4. Design Your Model
Once the data is imported, you can start designing your tabular model in the Visual Studio designer.
- Create Relationships: Define relationships between tables to establish connections for querying.
- Create Measures: Define calculations and aggregations using DAX (Data Analysis Expressions).
- Create Hierarchies: Organize data into hierarchies for drill-down analysis.
- Format Data: Apply formatting to columns and measures as needed.
5. Deploy the Model
After designing your model, you can deploy it to your Azure Analysis Services server.
- In Solution Explorer, right-click the Tabular Project and select Properties.
- In the Properties window, under Deployment, set the Server Name to your Azure Analysis Services server instance (e.g.,
asazure://.windows.net/). - Right-click the project again and select Deploy.
Tip: You can also connect to an existing model on your Azure Analysis Services server by choosing the "Connect to Existing Model" option when creating a new project.