> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/pivot-table/group-revenue-by-month.md).

# Group Revenue by Month

Group closed won revenue by owner and by month with the date grouping of the Pivot Table, month names in full, so a sales director sees who closed what when.

A sales director reviews closed won revenue once a month: who brought it in, and in which month. Grouping **Close Date** by month gives one column per month, with the owners down the side and the yearly total of each rep on the right.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2Fvcn7CWJ3LltzRps65Pr8%2Fpivot-table-group-revenue-by-month-result.png?alt=media" alt="Pivot table of closed won revenue with one row per owner and one column per month written in full, with yearly totals per owner and monthly totals"><figcaption><p>Revenue each owner closed, month by month, with full month names.</p></figcaption></figure>

## Before you start

* A Pivot Table on **Opportunity**. [Summarize Pipeline by Stage and Quarter](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/pivot-table/summarize-pipeline-by-stage-and-quarter.md) builds one; you can reuse it or start a new component the same way.
* Opportunities in the **Closed Won** stage this year, with an **Amount**.

## Steps

{% stepper %}
{% step %}

### Keep only this year's won deals

1. Select the Pivot Table and open its query.
2. Set the filter conditions to **Stage** equals `Closed Won` and **Close Date** equals `THIS_YEAR`.
3. Save the query.
   {% endstep %}

{% step %}

### Put the owners in the rows

1. In **Data Mappings**, set the only item of **Group Rows** to the opportunity owner's name (`Owner.Name`).
2. Turn on **Custom Label** and set **Label** to `Owner`.
   {% endstep %}

{% step %}

### Group the close dates by month

1. Set the only item of **Group Columns** to **Close Date**.
2. **Group**: **Month**.

The **Group** list decides how dates are bucketed:

| Group            | Use it for                             |
| ---------------- | -------------------------------------- |
| **Year**         | Several years side by side             |
| **Quarter**      | One year, by quarter                   |
| **Month**        | One year, by month                     |
| **Week**         | One year, by week                      |
| **Day**          | A short range, such as one month       |
| **Year-Quarter** | A range longer than a year, by quarter |
| **Year-Month**   | A rolling twelve months                |

*Note:* **Month** alone puts January of every year in the same column. The query is limited to this year, so that is what you want here. For a range that crosses a new year, pick **Year-Month**.
{% endstep %}

{% step %}

### Spell the months out

Turn on **Display Full Month Label** on the same item. The headers read "January", "February" instead of an abbreviation.

The setting appears only when **Group** is **Month** or **Year-Month**.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FpTgEUsxouSfBvGre4bIp%2Fpivot-table-group-revenue-by-month-mapping.png?alt=media" alt="Group Columns item for Close Date with Group set to Month and Display Full Month Label turned on" width="320"><figcaption><p>Display Full Month Label appears for Month and Year-Month.</p></figcaption></figure>
{% endstep %}

{% step %}

### Measure the revenue

1. Keep one item in **Aggregations**: **Field** **Amount**, **Measure** **Sum**.
2. Turn on **Custom Label** and set **Label** to `Revenue`.
3. Remove any other measure, such as a deal count, if you reused the pipeline table.
   {% endstep %}

{% step %}

### Add the totals and a title

1. In **Content**, turn on **Show Grand Total**. The last column shows each owner's revenue for the year, the last row each month's revenue for the team.
2. In **Header**, set **Title** to `Closed Won Revenue by Month`.
   {% endstep %}

{% step %}

### Save and test

Click **Save** and open the page where the component is placed.

The table lists one row per owner and one column per month with closed won deals, from "January" onward. Each cell holds the revenue that owner closed that month. A month in which an owner closed nothing shows $0.00.
{% endstep %}
{% endstepper %}

## Troubleshooting

<details>

<summary>Months of two years are added together</summary>

**Group** is **Month** and the query covers more than one year. Either keep the query to `THIS_YEAR`, or switch **Group** to **Year-Month** to get one column per month and year.

</details>

<details>

<summary>Display Full Month Label does not appear</summary>

**Group** must be **Month** or **Year-Month**. With **Quarter**, **Week** or **Day** there is no month name to write out.

</details>

<details>

<summary>"Group By with ROLLUP or CUBE must contain 3 fields or less"</summary>

The table has more than three groups in **Group Rows** and **Group Columns** together, and a date grouped by **Year-Quarter** or **Year-Month** counts as two. Owner plus **Year-Month** already uses three: to add a third group, switch the date to **Month**.

</details>

## Related tutorials

* [Summarize Pipeline by Stage and Quarter](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/pivot-table/summarize-pipeline-by-stage-and-quarter.md): the base table, by stage and quarter.
* [Filter and Export a Pivot Table](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/pivot-table/filter-and-export-a-pivot-table.md): filter by lead source, then send the table to Excel.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.avonnicomponents.com/dynamic-components/tutorials/components/pivot-table/group-revenue-by-month.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
