Skip to main content

Define Your Measures

Measures are the quantitative metrics that power your dashboards and reports. They represent numeric calculations derived from your underlying data through SQL aggregation functions and expressions. These measures transform raw data into meaningful business insights, such as total revenue, average order value, or customer count.

Measures are the "how much" and "how many" of your data. They provide the numerical foundation for your analysis, enabling you to:

  • Quantify performance: Track key business metrics like revenue, growth, and efficiency
  • Support decision-making: Provide concrete numbers for business decisions

Supported SQL Functions

  • Standard SQL numeric operators and functions
  • Common SQL aggregates: AVG, COUNT, MAX, MIN, SUM, STDDEV, VARIANCE
  • Advanced aggregates (engine-dependent): APPROX_COUNT_DISTINCT, APPROX_QUANTILE, STDDEV_POP, STDDEV_SAMP, VAR_POP, VAR_SAMP
  • Filtered aggregates can be used to filter the set of rows fed to the aggregate functions (syntax may vary by engine)
Engine-specific SQL dialects

Different OLAP engines support varying SQL dialects and functions. While standard SQL functions work across engines, some advanced features may be engine-specific. For engine-specific documentation, see:

As an example, if you have a table of sales events with the sales price and customer ID, you could calculate the following measures with these aggregates and expressions:

  • Number of sales: COUNT(*)
  • Total revenue: SUM(sales_price)
  • Revenue per customer: CAST(SUM(sales_price) AS FLOAT)/CAST(COUNT(DISTINCT customer_id) AS FLOAT)
  • Number of orders with order value more than $100: COUNT(*) FILTER (WHERE order_val > 100) (syntax may vary by engine)

Explore these advanced capabilities to enhance your measures: