Skip to main content

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.

Availability

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.

(Applies to dbt v1.12 and later)

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.

LocationTypeRequiredDescription
dimension:block or shorthandYes (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:stringYes for time dimensionsTime 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)

PropertyTypeRequiredDescription
typestringYestime or categorical.
namestringNoUnique within the semantic model; defaults to column name.
descriptionstringNoDocumentation for the dimension.
labelstringNoDisplay value in downstream tools.
is_partitionbooleanNoWhether this dimension is a partition dimension for the model (supported for time and categorical dimensions in YAML).
configobjectNoMetadata and config.
validity_paramsobjectNoFor 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 a dimension: block with time or categorical type, and optional name, 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.

0
Loading