> For the complete documentation index, see [llms.txt](https://docs.fabricplan.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fabricplan.com/planning-sheets/reference/formula-syntax/time-intelligence-functions/specific-time-periods.md).

# Specific time periods

Plan supports specific time period functions that retrieve data for individual months, quarters, or years. These functions help you select data for a single time period or a range of time periods for analysis and reporting.

### MONTHPERIOD

The *MONTHPERIOD* function returns a range of dates for a specified month or range of months within a given year. Use this function with the `SELECT.BYDATE` function and an aggregate function, such as `SUM` or `AVERAGE`, to retrieve and aggregate data over the returned date range.

#### Syntax

```
MONTHPERIOD(year, from_month, [to_month])
```

#### Arguments

* `year`: The year for which data is returned.
* `from_month`: Specifies the month for which data is returned or the starting month of the range. Valid values are `1` through `12`.
* `to_month` (optional): Specifies the ending month of the range. Valid values are `1` through `12`.

#### Return value

Returns a range of dates for the specified month or range of months.

#### Examples

```
MONTHPERIOD(2025,1,7)
```

Returns the date range from **January** to **July** of **2025**.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FZ9z9BW8Lys1cY81sUNcs%2Fimage.png?alt=media&amp;token=51f1bfcf-1a63-4c6d-bde1-ee15ac9b7b31" alt=""><figcaption></figcaption></figure>

```
MONTHPERIOD(2025,4)
```

Returns the date range for **April 2025**.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2F6JxvG2JIGr0Q73unZL1P%2Fimage.png?alt=media&amp;token=9c1e8039-5dba-4033-9243-88285c186f06" alt=""><figcaption></figcaption></figure>

### QTRPERIOD

The *QTRPERIOD* function returns a range of dates for a specified quarter or range of quarters in a given year. Use this function with the `SELECT.BYDATE` function and an aggregate function, such as `SUM` or `AVERAGE`, to retrieve and aggregate data over the returned date range.

#### Syntax

```
QTRPERIOD(year, from_quarter, [to_quarter])
```

#### Arguments

* `year`: The year for which data is returned.
* `from_quarter`: The quarter to return, or the starting quarter when specifying a range. Valid values are `1` through `4`.
* `to_quarter` (optional): The ending quarter of the range. Valid values are `1` through `4`.

#### Return value

Returns a range of dates for the specified quarter or range of quarters.

#### Examples

```
QTRPERIOD(2025,1,3)
```

Returns the date range from the first quarter through the third quarter of **2025**.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2F5YVXfiQi2npPMYg5WKXq%2Fimage.png?alt=media&amp;token=f9500af4-0128-4c44-b13b-755e2cde0d8f" alt=""><figcaption></figcaption></figure>

```
QTRPERIOD(2025,4)
```

Returns the date range for the fourth quarter of **2025**.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FmFD4fuFBrLgpsN3vfCWe%2Fimage.png?alt=media&amp;token=8b4c6ec9-9dcd-4ec1-8687-06e60439a9f6" alt=""><figcaption></figcaption></figure>

### YEARPERIOD

The *YEARPERIOD* function returns a range of dates for a specified year or range of years. Use this function with the `SELECT.BYDATE` function and an aggregate function, such as `SUM` or `AVERAGE`, to retrieve and aggregate data over the returned date range.

#### Syntax

```
YEARPERIOD(from_year, [to_year])
```

#### Arguments

* `from_year`: The year to return, or the starting year when specifying a range.
* `to_year` (optional): The ending year of the range.

#### Return value

Returns a range of dates for the specified year or range of years.

#### Examples

```
YEARPERIOD(2024,2026)
```

Returns the date range from **2024** through **2026**.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FOLSKJ25mdTWN8kxISRnV%2Fimage.png?alt=media&amp;token=05b6d7b9-d1e9-42ca-8c9a-3fbdd590bc34" alt=""><figcaption></figcaption></figure>

```
YEARPERIOD(2025)
```

Returns the date range for **2025**.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FcIQ2luQjmZFuMVXdS9rB%2Fimage.png?alt=media&amp;token=4065a6bd-707a-4892-b7a0-9af6096eecd1" alt=""><figcaption></figcaption></figure>


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.fabricplan.com/planning-sheets/reference/formula-syntax/time-intelligence-functions/specific-time-periods.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
