# Time intelligence functions

<table><thead><tr><th width="226.22216796875">NAME</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td><a href="time-intelligence-functions/aggregate">AGGREGATE</a></td><td>Performs the specified aggregation like minimum/maximum/average/sum on a measure over a specified time range.</td></tr><tr><td><a href="time-intelligence-functions/column_period">COLUMN_PERIOD</a></td><td>Returns the start, end, previous, or next time period as specified.</td></tr><tr><td><a href="time-intelligence-functions/filter">FILTER</a></td><td>Filters measure values across a period range that meet specified conditions.</td></tr><tr><td><a href="time-intelligence-functions/lastnday">LASTNDAY</a></td><td>Used to filter data for the last <em>n</em> days before the current date.</td></tr><tr><td><a href="time-intelligence-functions/lastnmonth">LASTNMONTH</a></td><td>Used to filter data for the last <em>n</em> months before the current month.</td></tr><tr><td><a href="time-intelligence-functions/lastnqtr">LASTNQTR</a></td><td>Used to filter data for the last <em>n</em> quarters before the current quarter.</td></tr><tr><td><a href="time-intelligence-functions/lastnyear">LASTNYEAR</a></td><td>Used to filter data for the last <em>n</em> years before the current year.</td></tr><tr><td><a href="time-intelligence-functions/monthperiod">MONTHPERIOD</a></td><td>Returns data for a month based on the year and month number.</td></tr><tr><td><a href="time-intelligence-functions/qtrperiod">QTRPERIOD</a></td><td>Returns data for a range of quarters based on the year and quarter number.</td></tr><tr><td><a href="time-intelligence-functions/yearperiod">YEARPERIOD</a></td><td>Returns data for the year(s) based on the input years passed.</td></tr><tr><td><a href="time-intelligence-functions/nextnday">NEXTNDAY</a></td><td>Used to filter data for the next <em>n</em> days after the current date.</td></tr><tr><td><a href="time-intelligence-functions/nextnmonth">NEXTNMONTH</a></td><td>Used to filter data for the next <em>n</em> months after the current month.</td></tr><tr><td><a href="time-intelligence-functions/nextnqtr">NEXTNQTR</a></td><td>Used to filter data for the next <em>n</em> quarters after the current quarter.</td></tr><tr><td><a href="time-intelligence-functions/nextnyear">NEXTNYEAR</a></td><td>Used to filter data for the next <em>n</em> years after the current year.</td></tr><tr><td><a href="time-intelligence-functions/mtd">MTD</a></td><td>Month-to-Date. Returns data from the 1st of the current month through the current date. An offset can be used to include data from the past months.</td></tr><tr><td><a href="time-intelligence-functions/qtd">QTD</a></td><td>Quarter-to-Date. Returns data from the 1st of the current quarter to the current date. An offset can be used to include data from the past quarters.</td></tr><tr><td><a href="time-intelligence-functions/ytd">YTD</a></td><td>Year-to-Date. Returns data from the start of the current year to the present date. An offset can be used to include data from the past years.</td></tr><tr><td><a href="time-intelligence-functions/movingaverage">MOVINGAVERAGE</a></td><td>Returns the moving average of a measure over a specified date range.</td></tr><tr><td><a href="time-intelligence-functions/movingsum">MOVINGSUM</a></td><td>Returns the moving sum of a measure over a specified date range.</td></tr><tr><td><a href="time-intelligence-functions/shift">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="time-intelligence-functions/totalmtd">TOTALMTD</a></td><td>Evaluates the month-to-date value of the measure in the current context. Returns data from the start of the current month up to the present date. </td></tr><tr><td><a href="time-intelligence-functions/totalqtd">TOTALQTD</a></td><td>Evaluates the quarter-to-date value of the measure in the current context. Returns data from the start of the current calendar or fiscal quarter up to the present date. </td></tr><tr><td><a href="time-intelligence-functions/totalytd">TOTALYTD</a></td><td>Evaluates the year-to-date value of the measure in the current context. Returns data from the start of the current calendar or fiscal year (e.g., January 1) up to the present date.</td></tr><tr><td><a href="time-intelligence-functions/valueat">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></tbody></table>
