Skip to main content

Overview

Measures are quantitative calculations and aggregations that provide business insights (like total revenue, average order value, or customer count). Measures enable you to analyze and aggregate your data in meaningful ways, providing the “what” to your dimensions’ “how.”

Measure Types

Measure Properties

Basic Measures

Count

Count the number of records:

Sum

Sum numeric values:

Average

Calculate the arithmetic mean:

Min/Max

Find minimum or maximum values:

Count Distinct

Count unique values:

Median

Calculate the median value:

Filtered Measures

Apply filters to create conditional aggregations:

Custom Measures

For complex calculations, use the custom type:

Cross-Entity Measures

Reference dimensions or measures from related entities using {{entity.field}} syntax:

Best Practices

Naming

  • Use descriptive names that indicate the metric (e.g., total_revenue, avg_order_value)
  • Prefix with aggregation type when helpful (e.g., avg_, total_, max_)
  • Avoid technical prefixes like msr_ or measure_

Documentation

  • Always provide clear descriptions
  • Add synonyms for metrics commonly referenced with different terms
  • Document any business rules or calculations
  • Include example values when helpful

Expression Design

  • Always use NULLIF to prevent division by zero
  • Handle NULL values appropriately in calculations
  • Consider performance implications of complex expressions
  • Test custom measures thoroughly

Filtered Measures

  • Use filtered measures instead of creating separate views
  • Name filtered measures descriptively (e.g., large_orders_count)
  • Document the filter conditions in the description
  • Consider performance when applying multiple filters

Common Patterns

Revenue Metrics

Customer Metrics

Product Performance

Time-Based Metrics

Dimensions

Define dimensions for grouping

Views

Learn about creating views

Entities

Define entities and relationships

Overview

Back to semantic model overview