Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to: ✅ Microsoft Fabric ✅ Azure Data Explorer ✅ Azure Monitor ✅ Microsoft Sentinel
Provides the end of the year containing the date, shifted by an offset, if provided.
Syntax
endofyear(date [, offset])
Learn more about syntax conventions.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| date | datetime |
✔️ | The date used to find the end of the year. |
| offset | int |
The number of offset years from date. Default is 0. |
Returns
Returns a datetime representing the end of the year for the given date value, with the &offset, if specified.
Examples
The following example returns the end of the year for the specified date.
range offset from -1 to 1 step 1
| project yearEnd = endofyear(datetime(2017-01-01 10:10:17), offset)
Output
| yearEnd |
|---|
| 2016-12-31 23:59:59.9999999 |
| 2017-12-31 23:59:59.9999999 |
| 2018-12-31 23:59:59.9999999 |