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

# Opex: Operating Expenses

> Track operating expenses for your Shopify store. Understand total opex costs deducted from contribution margin.

<Tip>
  Opex tracks user-defined operating expenses from order cost entries. These costs are deducted from CM3 to calculate CM4.
</Tip>

## Formula

<Info>
  **Opex** = **SUM** ( Order Cost Entries ) **WHERE** category = Operating Expenses
</Info>

### Formula Components

| Metric                            | Definition                                             |
| --------------------------------- | ------------------------------------------------------ |
| **Order Cost Entries**            | User-defined costs configured in Upstack Cost Settings |
| **category = Operating Expenses** | Filters to costs categorized as opex                   |

| Metadata        |                                         |
| --------------- | --------------------------------------- |
| **Type**        | Currency                                |
| **Data Source** | [Upstack Costs](/sources/upstack-costs) |
| **Aggregation** | Sum                                     |

***

## Example

Your Shopify store has **\$25,000** in operating expenses allocated across **500 orders**.

| Metric         | Value    | Calculation              |
| -------------- | -------- | ------------------------ |
| Total Orders   | 500      | All orders in period     |
| Opex           | \$25,000 | Sum of opex cost entries |
| Opex Per Order | \$50.00  | \$25,000 ÷ 500           |

Operating expenses include overhead costs like rent, salaries, software subscriptions, and other fixed business costs.

***

## How It Works

Opex is pulled from cost entries you configure in Upstack Cost Settings. Fixed monthly costs are allocated across orders in the period. These costs are deducted after CM3 to calculate CM4, giving you a complete view of business profitability.

***

## When to Use

| Scenario                        | Action                                          |
| ------------------------------- | ----------------------------------------------- |
| Complete profitability analysis | Include opex in contribution margin             |
| Break-even analysis             | Understand minimum revenue needed to cover opex |
| Scaling decisions               | Model how opex changes with volume              |
| Cost allocation                 | Track opex impact per order                     |

***

## Related Metrics

| Metric                                                                           | Relationship                                     |
| -------------------------------------------------------------------------------- | ------------------------------------------------ |
| [NC Opex](/reference/metrics/orders/contribution-margin/new-customer-opex)       | Operating expenses for new customer orders       |
| [RC Opex](/reference/metrics/orders/contribution-margin/returning-customer-opex) | Operating expenses for returning customer orders |
| [Agency Fees](/reference/metrics/orders/contribution-margin/agency-fees)         | Agency costs, also deducted for CM4              |
| [Total Cost](/reference/metrics/orders/contribution-margin/total-cost)           | All costs combined                               |

[See all Contribution Margin metrics →](/reference/metrics/orders/contribution-margin)
