Dimension properties
Dimensions are non-aggregatable expressions that define how metrics can be grouped or sliced. They are always defined within a semantic model. See Dimensions for concepts and examples.
The latest YAML spec is supported in the following environments:
- dbt platform (Latest release track)
- dbt Fusion engine
- dbt Core v1.12
For more information, refer to Migrate to the latest YAML spec.
Latest spec (model YAML)
Dimensions are defined at the column level.
Column-level placement (latest spec)
Add these keys to a column under the semantic model’s columns: list — they are not nested inside the dimension: object.
| Location | Type | Required | Description |
|---|---|---|---|
dimension: | block or shorthand | Yes (to define a dimension) | Attaches a dimension to the column. Use a mapping (dimension: with type, etc.) or the shorthand dimension: categorical / dimension: time. |
granularity: | string | Yes for time dimensions | Time grain of the underlying column data (for example, day, week, month). Place granularity: on the column next to dimension:, not inside the dimension: block. For categorical dimensions, granularity is not meaningful; if it appears in YAML, validation should surface an error. |
Properties inside the dimension: block (latest spec)
| Property | Type | Required | Description |
|---|---|---|---|
type | string | Yes | time or categorical. |
name | string | No | Unique within the semantic model; defaults to column name. |
description | string | No | Documentation for the dimension. |
label | string | No | Display value in downstream tools. |
is_partition | boolean | No | Whether this dimension is a partition dimension for the model (supported for time and categorical dimensions in YAML). |
config | object | No | Metadata and config. |
validity_params | object | No | For time dimensions: SCD-style validity (for example, is_start, is_end). |
Derived dimensions: To define dimensions with an expr that is not tied to a single column, use the semantic model’s optional derived_semantics.dimensions list. That structure is part of the semantic model configuration (alongside columns:), not a property nested under a column’s dimension: block. See Semantic models and Dimensions for examples.
- Column-level: Under the model's
columns:list, each column can have adimension:block with time or categorical type, and optionalname,description,label,is_partition,config. - Time dimensions: The column must also have a top-level
granularity:(for example,day). - Validity (SCD): Time dimensions can specify
validity_params(for example,is_start,is_end).
For concepts and usage patterns, refer to Dimensions. For the latest spec, refer to Semantic models.
Was this page helpful?
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.