> ## Documentation Index
> Fetch the complete documentation index at: https://www.propeldata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Types of Metrics

> Learn about the different types of metrics.

<div />

| Type                                   | Description                                                                                                                                                                                                                  | Example                                                   |
| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
| **Count**                              | Counts the number of records that match the filters. <br /><br />For Time Series queries, it will count the values for each time granularity.                                                                                | `Order count`                                             |
| **Count Distinct**                     | Counts the number of distinct values in the specified column for every record that matches the filters. <br /><br />For Time Series queries, it will count the distinct values for each time granularity.                    | Unique customers                                          |
| **Max**                                | Selects the maximum value of the specified column for every record that matches the filters. <br /><br />For Time Series queries, it will select the maximum value for each time granularity.                                | Maximum order size in dollars                             |
| **Min**                                | Selects the minimum value of the specified column for every record that matches the filters. <br /><br />For Time Series queries, it will select the minimum value for each time granularity.                                | Minimum order size in dollars                             |
| **Average**                            | Averages the values of the specified column for every record that matches the filters. <br /><br />For Time Series queries, it will average the values for each time granularity.                                            | Average revenue per order                                 |
| [**Custom**](#defining-custom-metrics) | Applies a SQL expression to the values of the specified columns for every record that matches the filters. <br /><br />For Time Series queries, it will apply the custom expression to the values for each time granularity. | Total price defined as: `SUM(unit_price) * SUM(quantity)` |

## Examples

### Count

```graphql theme={"system"}
...
metric: {
  count: {
    dataPool: {
      name: "TacoSoft Demo Data"
    }
  }
}
...
```

### Count Distinct

```graphql theme={"system"}
...
metric: {
  countDistinct: {
    dataPool: {
      name: "TacoSoft Demo Data"
    },
    dimension: {
      columnName: "order_id"
    }
  }
}
...
```

### Max

```graphql theme={"system"}
...
metric: {
  max: {
    dataPool: {
      name: "TacoSoft Demo Data"
    },
    measure: {
      columnName: "unit_price"
    }
  }
}
...
```

### Min

```graphql theme={"system"}
...
metric: {
  min: {
    dataPool: {
      name: "TacoSoft Demo Data"
    },
    measure: {
      columnName: "unit_price"
    }
  }
}
...
```

### Average

```graphql theme={"system"}
...
metric: {
  average: {
    dataPool: {
      name: "TacoSoft Demo Data"
    },
    measure: {
      columnName: "unit_price"
    }
  }
}
...
```

### Custom

```graphql theme={"system"}
...
metric: {
  custom: {
    dataPool: {
      name: "TacoSoft Demo Data"
    },
    expression: "SUM(unit_price) * SUM(quantity)"
  }
}
...
```
