# Time intelligence functions

<table><thead><tr><th width="264">NAME</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td><a href="/pages/1C0FQdV4lT81XwOtP171">AGGREGATE</a></td><td>Performs a specific aggregation like minimum/maximum/average/sum on a measure over a specified time range.</td></tr><tr><td><a href="/pages/JQn5z0zutzIWUvNmjhgu">COLUMN_PERIOD</a></td><td>Returns the start/end/previous or next time period</td></tr><tr><td><a href="/pages/getuJY0EcXytgilW7GAA">FILTER</a></td><td>Filters measure values across a period range and returns only those values that satisfy specified conditions</td></tr><tr><td><a href="/pages/iy6VcuxDD0yJqKgQO1B6">LASTNDAY</a></td><td>Returns data for last n days</td></tr><tr><td><a href="/pages/PBjEdEj1ACZgOojxelhU">LASTNMONTH</a></td><td>Returns data for last n months</td></tr><tr><td><a href="/pages/hqWXQxzY8iauxKiR08Ab">LASTNQTR</a></td><td>Returns data for last n quarters</td></tr><tr><td><a href="/pages/VfOpP8Jr1AfcZCsbY7jd">LASTNYEAR</a></td><td>Returns data for last n years</td></tr><tr><td><a href="/pages/A4xz0bZzWFCFPGkltkYF">MONTHPERIOD</a></td><td>Returns data for a month based on the year and month number</td></tr><tr><td><a href="/pages/FfNPAKNyMCF1TD849F5x">MOVINGAVERAGE</a></td><td>Returns the average of a measure over a specified date range.</td></tr><tr><td><a href="/pages/qv8QTFBHbaCj4WTkzyWD">MOVINGSUM</a></td><td>Returns the sum of a measure over a specified date range.</td></tr><tr><td><a href="/pages/RF1iMJbqfCTXTicFiXRf">MTD</a></td><td>Returns data for the current month(s) till date</td></tr><tr><td><a href="/pages/tH7hPOP9x14Sk89VzFet">NEXTNDAY</a></td><td>Returns data for next n days</td></tr><tr><td><a href="/pages/gcGe5aEdpUV6vlUwLfZG">NEXTNMONTH</a></td><td>Returns data for next n months</td></tr><tr><td><a href="/pages/zsQVHHCKmoXGfHBZUgSP">NEXTNQTR</a></td><td>Returns data for next n quarters</td></tr><tr><td><a href="/pages/2NuyAp8GkpPQLvp7nA8z">NEXTNYEAR</a></td><td>Returns data for next n years</td></tr><tr><td><a href="/pages/7s7ff9NZQCj4V7QnTtJ0">QTD</a></td><td>Returns data for the current quarter(s) till date</td></tr><tr><td><a href="/pages/PtMFQZ1tKBJIoLxqdilT">QTRPERIOD</a></td><td>Returns data for a range of quarters based on the year and quarter number</td></tr><tr><td><a href="/pages/9g61ULb2G0uklceShu0Q">SHIFT</a></td><td>Returns the date after shifting a date either backwards or forwards by a specified time period</td></tr><tr><td><a href="/pages/OpjFvBwN1RQG4Xo2IGff">TOTALYTD</a></td><td>Evaluates the year-to-date value of the measure in the current context</td></tr><tr><td><a href="/pages/WvoUs6vZ5txZVaLlnG3K">TOTALQTD</a></td><td>Evaluates the quarter-to-date value of the measure in the current context</td></tr><tr><td><a href="/pages/nnXYHJnXfxMfAihPXnQw">TOTALMTD</a></td><td>Evaluates the month-to-date value of the measure in the current context</td></tr><tr><td><a href="/pages/ZnMpVkVR4FNQ88kCZRYE">YEARPERIOD</a></td><td>Returns data for a year based on the input years passed</td></tr><tr><td><a href="/pages/JX1C8SFnCPG0JiHH8JP1">VALUEAT</a></td><td>Returns the value of a measure for a specified date or a date shift relative to the current column.</td></tr><tr><td><a href="/pages/LYksOE8tIEu380optTv3">YTD</a></td><td>Returns data for the current year(s) till date</td></tr></tbody></table>


---

# Agent Instructions: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
