# Expression measures

FastStats expressions are used to calculate values for tables, cubes, and other visualisations. They can be used anywhere that there is a measure in a dashboard tile.

> [!NOTE]
>
> This is an advanced feature for experienced FastStats users.

> [!NOTE]
>
> As this is a measure, only numeric expressions can be used. Using queries or on-the-fly aggregations in the expression is not currently supported.

> [!NOTE]
>
> For more context around building and using expressions, see the [FastStats help content for expressions](<https://help.apteco.com/en/faststats/expressions/index.md>).

## Adding an expression measure

To add an expression measure:

1. Click **Add Measure**.

   If an expression can be added here, then the search dialog has an extra expression tab.
2. Enter the **Name** for the expression.

   This is used elsewhere to identify the expression.
3. The expression requires a counting table, and the text of the expression itself (Orbit validates the expression as you type).
4. A valid expression calculates a value for each record on the counting table.
5. Choose a function to use to summarise these values in each cell of the table.

   The example below creates a measure that displays the mean distance in miles from Apteco’s Warwick office for each region.

   You have now completed an expression measure.

   > **Note**
   >
   > Expressions can be used as Expression measures, or in [Filtering](<https://help.apteco.com/en/orbit/dashboards/filtering/index.md>).

## Expression measure validation

> [!NOTE]
>
> Expression measures in Orbit are an advanced feature for experienced users.

> [!NOTE]
>
> For more context around building and using expressions, see the [FastStats help content for expressions](<https://help.apteco.com/en/faststats/expressions/index.md>).

Expressions in Orbit are validated when the ‘Apply’ button is pressed but at the moment the expression validation is limited.

Expression validation cannot yet:

- Detect if you use expression functionality only supported on a version of FastStats that is newer than the one your system uses

Expression validation ensures that:

- The expression has correct syntax, for example:

  - Functions are spelt correctly
  - Brackets are all complete and matching
- Any FastStats variables that are used exist, and belong to the same table as the expression, or an ancestor table
- No queries or aggregations are used
- The output type (e.g. Numeric, Text) of the expression is suitable for the context
