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

# Percent of column total

> Calculate each value as a percentage of its column total

> [!NOTE]
>
> A [formula table calculation](https://docs.meetsilicon.com/explore/table-calculations/formulas.md) computes this without hand-written SQL -- see the [percent-of-total example](https://docs.meetsilicon.com/explore/table-calculations/formulas.md#examples): `=revenue / SUM(revenue) * 100`.

[Just gimme the code! ](#heres-the-sql-you-can-copy-paste-to-calculate-the-percent-of-the-column-total)

Here's an example of a percent of the total column:

And here's the SQL used in the table calculation:

```sql theme={null}
${orders.total_order_amount} / SUM(${orders.total_order_amount}) OVER()
```

In general, the SQL used for calculating the percent of the total has just one important column:

* `column_i_want_to_see_the_percent_of_total` - this is the column that you want to see each value's percent of the total values in that column

### Here's the SQL you can copy-paste to calculate the percent of the column total

```sql theme={null}
${table.column_i_want_to_see_the_percent_of_total} /
  SUM(${table.column_i_want_to_see_the_percent_of_total}) OVER()
```

### Make sure to add percent formatting to your calculation

In the `format` tab, make sure to update the format to `percent` so that your table calculation is shown as a percentage value (instead of a number).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.