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

# Profitability

> How Pike calculates earnings, cost, and profit across workspace and project finance views.

Profitability shows whether work is earning more than it costs. Pike compares **earnings** (revenue) against **cost** (labor, overhead, and certain expenses) and reports **profit** as the difference.

Available to **admins, managers, and finance** users.

## Where to find it

| Location               | Scope           |
| ---------------------- | --------------- |
| **Finance → Overview** | Whole workspace |
| **Project → Finance**  | Single project  |

Both surfaces show earnings, cost, profit, and a cumulative chart. The workspace overview also includes billed/unbilled time stats and a monthly financial chart.

For project-level charts and toggles, see [Project finance](/project/project-finance).

## The core formula

For every period (grouped by month):

```
profit = earnings − cost
```

Totals at the top of the card are the sum of all monthly data points in the selected range.

Each data point contains:

| Field        | Meaning                                |
| ------------ | -------------------------------------- |
| **Earnings** | Revenue attributed to that month       |
| **Cost**     | Internal cost attributed to that month |
| **Profit**   | Earnings minus cost                    |

## Three profitability modes

Pike calculates profitability in three ways. Two are **actual** (based on logged work or invoices). One is **planned** (based on future allocations).

### 1. Actual — Billable time

**Revenue calculation method: Billable time**

Earnings come from **completed time entries** on billable work:

```
earnings = hours logged × billable rate on the task assignment
```

* Only time entries with an **end time** (completed entries) are included.
* The billable rate is the **rate on the member's task assignment** (`userTask.rate`), not the invoice rate.
* Revenue is grouped by the **month the time entry started**.

Cost for the same entries:

```
cost = hours logged × (employment hourly cost + hourly overhead)
```

This mode answers: *"Based on time we tracked and the rates on those tasks, how profitable was the work?"*

### 2. Actual — Revenue booked

**Revenue calculation method: Revenue booked**

Earnings come from **invoices**:

```
earnings = invoice total × exchange rate
```

* Revenue is grouped by the invoice **due date** month.
* Invoice line items and tax/discount handling follow standard invoice total calculation.

Cost still comes from **time entries** in the filtered scope (same labor + overhead formula as billable time), plus qualifying **expenses** (see below). Time entry cost is grouped by the month the entry **started**.

This mode answers: *"Based on what we invoiced and what the work cost us, how profitable was the period?"*

### 3. Planned

**Planned profitability** (shown as a comparison line on the cumulative chart) comes from **resource allocations** — scheduled hours on tasks:

```
planned earnings = allocated hours × task assignment rate
planned cost     = allocated hours × (employment hourly cost + hourly overhead)
```

* Allocations are clipped to calendar month boundaries.
* Hours per day come from the allocation's weekday schedule (Monday–Sunday minutes).
* Only allocations whose date range overlaps the filter are included.

This mode answers: *"If we deliver what is currently planned on the schedule, what profitability should we expect?"*

## How cost is built

Total **cost** per month is:

```
cost = labor cost + overhead + qualifying expenses
```

### Labor cost (employment contract)

For each hour of work (logged or planned), Pike looks up the member's **employment contract** and derives an hourly employment cost from:

| Contract frequency | Hourly employment cost                            |
| ------------------ | ------------------------------------------------- |
| Hour               | Cost amount directly                              |
| Week               | Cost amount ÷ hours per week                      |
| Biweek             | Cost amount ÷ (hours per week × 2)                |
| Month              | Cost amount ÷ monthly working hours from contract |
| Year               | Cost amount ÷ yearly working hours from contract  |

**Monthly / yearly working hours** use business days (weekends excluded) and the contract's **hours per week**:

```
working hours = (business days ÷ 5) × hours per week
```

If a member has **no contract**, employment hourly cost is **0** for that member in profitability. Overhead may still apply if they are assigned overhead items.

For how contracts feed hourly cost on member profiles, see [Cost profile](/members/cost-profile).

### Overhead

**Hourly overhead** from assigned [overhead cost](/finance/overhead-costs) line items is added to the employment hourly cost:

```
loaded hourly cost = employment hourly cost + hourly overhead
```

See [Overhead costs](/finance/overhead-costs) for allocation rules and the contract-based hours conversion.

### Expenses

Project **expenses** add to cost when **either**:

* the expense has **no project**, or
* the expense is **not billable**

Billable expenses linked to a project are **excluded** from profitability cost (they are treated as pass-through to the client, not internal cost).

Expense cost uses `amount × exchange rate` and is grouped by **date incurred** month.

## Filters

Profitability respects filters passed to the calculation. What you select determines which time entries, invoices, allocations, and expenses are included.

### Supported filters

| Filter         | Effect                                                                                                         |
| -------------- | -------------------------------------------------------------------------------------------------------------- |
| **Date range** | Limits records to the period. If omitted on the API, the range is inferred from the data                       |
| **Customer**   | Only work / invoices / expenses linked to those customers                                                      |
| **Project**    | Only work / invoices / expenses on those projects                                                              |
| **Team**       | Only work on tasks belonging to those teams. For invoices and expenses, the project must be linked to the team |

Filters combine with **AND** logic: a record must match every filter you set.

### Where filters appear in the product

| Surface                | Default filters                                               | Notes                                         |
| ---------------------- | ------------------------------------------------------------- | --------------------------------------------- |
| **Finance → Overview** | Date range (current year), optional customer / project / team | Uses the shared time-entry filter bar         |
| **Project → Finance**  | Fixed to the **current project**                              | No customer/team picker; scoped automatically |

### Person / member filter

The time-entry filter bar on Finance Overview includes a **member** filter. That filter applies to billed/unbilled stats on the page. Profitability totals use **customer**, **project**, **team**, and **date range** only.

<Note>
  To review one person's contribution, narrow by **project** or **team**, or
  review their logged time and contract/overhead setup on the member profile.
</Note>

## Date grouping and chart behaviour

* Results are aggregated into **monthly** data points.
* The cumulative chart stacks profit over time within the filtered range.
* **Planned** profitability is always fetched alongside actuals for comparison on the chart.

### How the effective date range is chosen

When you set a date range explicitly, that range is used.

When you do not, Pike infers the range from the data:

| Mode           | Range derived from                                                                       |
| -------------- | ---------------------------------------------------------------------------------------- |
| Billable time  | Earliest to latest **time entry** month, extended by expense months if present           |
| Revenue booked | Earliest to latest **invoice due date** month, merged with time entry and expense months |
| Planned        | Earliest allocation start to latest allocation end                                       |

## Revenue vs cost timing

Billable time and revenue booked can tell different stories because **earnings** and **cost** use different anchors:

| Mode           | Earnings dated by          | Cost dated by                                           |
| -------------- | -------------------------- | ------------------------------------------------------- |
| Billable time  | Time entry **start** month | Time entry **start** month                              |
| Revenue booked | Invoice **due date** month | Time entry **start** month + expense **incurred** month |

An invoice raised in March for January work will show revenue in March (revenue booked) but cost in January (when time was logged).

<Tip>
  Switch between **Billable time** and **Revenue booked** when month-to-month
  profit looks off. Timing differences between logged work and invoice due dates
  are expected — pick the mode that matches the question you are answering.
</Tip>

## Access and permissions

| Feature                                    | Roles                           |
| ------------------------------------------ | ------------------------------- |
| View profitability endpoints               | Admin, Manager, Finance         |
| Manage overhead (affects cost)             | Admin                           |
| Manage employment contracts (affects cost) | Admin, HR (contract management) |

## Prerequisites for accurate numbers

Profitability is only as good as the underlying data.

| Data                       | Affects                            | If missing                               |
| -------------------------- | ---------------------------------- | ---------------------------------------- |
| **Task assignment rate**   | Earnings (billable time & planned) | Earnings = 0 for that work               |
| **Employment contract**    | Labor cost                         | Labor cost = 0 for that member           |
| **Overhead assignment**    | Loaded cost                        | Only base contract cost used             |
| **Completed time entries** | Actual profitability               | Open timers excluded                     |
| **Billable flag on tasks** | Billable time earnings             | Non-billable tasks excluded from revenue |

## Example walkthrough

**Setup**

* Developer logs **10 h** in March on a billable task at **£150 / h** billable rate.
* Contract: **£6,000 / month**, 37.5 h/week → \~£36 / h employment cost.
* Overhead share: **£2 / h**.
* Loaded cost: **£38 / h**.

**Billable time mode (March data point)**

```
earnings = 10 × £150 = £1,500
cost     = 10 × £38   = £380
profit   = £1,120
```

**Revenue booked mode** — same cost, but earnings appear in the month the **invoice is due**, not necessarily March.

## Related documentation

<Card title="Overhead costs" icon="layer-group" iconType="solid" href="/finance/overhead-costs">
  Shared expenses, allocation rules, and how hourly overhead loads onto labor
  cost.
</Card>

<Card title="Cost profile" icon="coins" iconType="solid" href="/members/cost-profile">
  Set member contracts, capacity, and hourly employment cost.
</Card>

<Card title="Project finance" icon="chart-line" iconType="solid" href="/project/project-finance">
  Profitability, budgets, and invoices on a single project.
</Card>
