Working with Composite Models
Composite models are a Public Preview feature.
Composite models are made up of multiple models that share dimensions, as well as calculations specific to the composite model itself. When you deploy a composite model, all of its referenced objects are deployed as a single model.
Composite models do not include the following objects from their referenced models:
- User-defined aggregates
- Partitions
- Perspectives
- Drill-throughs
The following sections describe how to work with composite models in Design Center.
Create a composite model
To create a composite model:
-
In the Workspace panel, click the Create file button and select Composite_model.yml.
-
Enter a unique name for the model, then press
Enter
on the keyboard. The composite model appears in themodels/
folder in the Workspace panel, and the Composite model properties panel opens. -
In the panel, edit the following fields as needed:
- Model: The name of the composite model that appears in BI tools.
- Unique name: The unique name of the composite model. This must be unique across all repositories and subrepositories.
- Description: Optional. A description of the composite model.
-
Add models to the composite model. You can click and drag the models you want to add from the Workspace panel to the Canvas.
The models you add must meet the following criteria:
- They cannot be other composite models.
- They must all have at least one dimension in common.
-
Add calculations to the composite model. You must add at least one calculation.
-
At the top of the Canvas, click Add to Composite model > New Calculation. The Calculation properties panel opens.
-
Complete the following fields:
-
Name: The name of the calculation that appears in BI tools.
-
Unique Name: The unique name of the calculation. This must be unique across all repositories and subrepositories.
-
Description: Optional. A description of the calculation.
-
MDX Aggregation Function: The aggregation function to use when this calculation is referenced via the Aggregate MDX function.
noteAtScale recommends selecting a value for this field if you plan on referencing this calculation from calculation groups. Otherwise, you may encounter errors at query time.
-
Visible in BI Tool: Determines whether the calculation appears in BI tools.
-
Formatting: The format for results of queries against the calculation. If you select Custom, you must also enter a custom format.
-
-
In the Formula field, click the edit icon to open the Formula window, then enter the MDX formula you want to use.
When editing your formula, be aware of the following:
- The formula can only contain references to objects that appear in the referenced models.
- The formula must return a numeric value.
- When using Power BI, AtScale recommends using the hierarchy name in the expression, rather than the dimension name.
- You cannot combine metrics from multiple fact tables in the same formula if it contains CURRENTMEMBER.NAME.
- You can only evaluate dimensions in a calculation formula with metrics from a single fact table.
-
Click Test MDX Syntax to validate your formula.
-
Click outside of the Formula window to close it.
-
In the Calculation properties panel, click Apply to save your changes.
-
Deploy a composite model
Composite models are deployed when you deploy the catalog they belong to, just like any other model. All of a composite model's referenced objects are deployed as a single model.
When deploying composite models, be aware of the following:
- Composite models do not inherit runtime permissions from their referenced models. If you need to restrict BI tool user access to a composite model, you need to configure its runtime permissions separately from the other models. For more information, see Configuring Permissions on Deployed Models.
- Composite models do not inherit settings from their referenced models. If you want to apply settings to a composite model, you need to add a separate entry for it to your
model_settings.yml
file. For more information, see Configuring Model Settings.
For more information on deploying catalogs and models, see Deploying a Catalog.