Measures are measurements that can go up and down over time. Each measure should map to a measurement of a process or workflow in your organization. Counts of events, revenues and cycle times are good examples of measures you may want to add to your data model.

You can setup and update measures from the Add Data Model workflow.

Types of measures

NameInput Column TypeDescription
row countNo input column requiredCount of rows.
custom measureNo input column requiredA SQL-based custom aggregation. See Custom SQL Measures for more details.
countString or NumericSQL COUNT(). Counts the number of non-null values in a column.
count distinctString or NumericSQL COUNT(DISTINCT). Counts the number of unique, non-null values in a column.
minNumericSQL MIN(). Finds the minimum value of a column.
maxNumericSQL MAX(). Finds the maximum value of a column.
avgNumericSQL AVG(). Finds the arithmetic mean of a column.

The row count measure

The row count measure is added by default to a data model and can't be removed. This is intentional - see the best practices for defining this measure in the Data Modeling Best Practices.

Column aggregations

The simplest type of measure. See table above for which functions you can run on specific measures.

To add a column aggregating measure:

  1. Go to the Add Data Model workflow by creating a new data model or editing an existing model.
  2. In the list of fields, click Add measure next to the name of the field you'd like to aggregate.
  3. Click on the new item in the measure list to expand the and select the aggregation type.

Custom SQL measures

Custom SQL measures allow you to have more involved custom aggregations in Hashboard like weighted averages or proportions and other formulas. You can define a custom measure as any aggregating function (opens in a new tab) that results in a numeric value.

To add a custom measure:

  1. Go to the Add Data Model workflow by creating a new data model or editing an existing model.
  2. Under the Measures section click the + Add Custom Measure button.
  3. Enter your aggregation and click the 🔄 button to test the SQL.

Referencing other measures or attributes

Custom measures can refer to other measures or attributes to avoid duplicating logic. For instance, a Profit measure could be defined by deducting the Costs measure from the Revenue measure.

SQL for Profit measure
{{ revenue }} - {{ cost }}

SQL can reference other measures or attributes by surrounding their alias in double curly braces. When querying, Hashboard will expand references to their full definitions.

Using joined columns in custom SQL

See Using Joined Columns in Custom SQL for more info.