> 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/time-shifting-and-lookup.md).

# Time shifting and lookup

Plan supports time shifting and lookup functions that retrieve values from different time periods. These functions help you shift between time periods and access measure values for comparative and trend analysis.

### SHIFT

The *SHIFT* function returns a date by shifting a specified date forward or backward by a given time interval, such as months, quarters, or years.

#### Syntax

```
SHIFT(inputDate, offset)
```

#### Arguments

* `inputDate`: The date to shift.
* `offset`: Specifies the number of time intervals by which the date is shifted. Use a positive value to shift the date forward and a negative value to shift it backward. Supported interval formats include months (`M`), quarters (`Q`), and years (`Y`).

#### Return value

Returns the date obtained by shifting the input date by the specified time interval.

#### Examples

```
SHIFT(COLUMN.CURRENT_PERIOD, "2M")
```

Returns the date two months after the current period. For example, if the current period is **January**, the function returns the corresponding date in **March**.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FBypD7AHmLc7cqUh1uRBW%2Fimage.png?alt=media&amp;token=1633d736-c235-4997-a8bb-b01105e1341c" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}

#### Note

Set the **Data type** to **Date** when configuring the **`SHIFT`** function to view the shifted date. Otherwise, the function returns a **`#VALUE!`** error.
{% endhint %}

The following formula shifts each *Open Date* by two months. For example, if the *Open Date* is `05/22/2026`, the function returns `7/22/2026`.

```
SHIFT([Open Date], "2M")
```

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2Fvlc0NI5fv9fX7dbmFRRR%2Fimage.png?alt=media&amp;token=654f67ae-519e-4516-b0ae-378eb6dafdf5" alt=""><figcaption></figcaption></figure>

You can also use the *SHIFT* function with forecast open and closed periods. For example, you can shift the forecast open period end date backward by two quarters.

```
SHIFT([Forecast].OPEN_END, "-2Q")
```

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FxiAQlaWLMB0keupBhgs6%2Fimage.png?alt=media&amp;token=229ff50c-e6ba-4f89-8a9c-512a76c7ddb5" alt=""><figcaption></figcaption></figure>

### VALUEAT

The *VALUEAT* function returns the value of a measure at a specified time offset relative to the current reporting period.

#### Syntax

```
VALUEAT(measure, offset)
```

#### Arguments

* `measure`: The measure for which the value is returned.
* `offset`: Specifies the number of time intervals by which the value is shifted. Use a positive value to retrieve a value from a future period and a negative value to retrieve a value from a previous period. Supported interval formats include months (`M`), quarters (`Q`), and years (`Y`).

#### Return value

Returns the value of the specified measure at the given time offset.

#### Examples

```
VALUEAT([Sales], "-1M")
```

Returns the *Sales* value from the previous month.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FWKrc2qnbTiHTJs5eoxz2%2Fimage.png?alt=media&amp;token=c04987aa-3d3f-4f3d-ad46-b71fdec67628" alt=""><figcaption></figcaption></figure>

```
VALUEAT([Sales], "1Q")
```

Returns the *Sales* value from the next quarter.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FTMQEeK1Abfxapi9cDjkj%2Fimage.png?alt=media&amp;token=8fa8189a-45ab-4c3d-aaa0-ccd71e1c3e69" 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/time-shifting-and-lookup.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.
