STARTOFYEAR function



Description

Returns the first date of the year in the current context for the specified column of dates.

Syntax

STARTOFYEAR (<dates>, [<Year_end_date>]) 

Parameters

Sr.No. Parameter & Description
1

dates

A column that contains dates.

2

Year_end_date

Optional.

A year end date value.

If omitted, default is 31st December.

Return Value

A table containing a single column and a single row with a date value.

Remarks

The dates parameter can be any of the following −

  • A reference to a date/time column.

  • A table expression that returns a single column of date/time values.

  • A Boolean expression that defines a single-column table of date/time values.

Constraints on Boolean expressions −

  • The expression cannot reference a calculated field.

  • The expression cannot use CALCULATE function.

  • The expression cannot use any function that scans a table or returns a table, including aggregation functions.

However, a Boolean expression can use any function that looks up a single value, or that calculates a scalar value.

The year_end_date parameter is a string literal of a date, in the locale where the workbook was created. The year portion of the date is ignored.

Example

= STARTOFYEAR (Sales [Date]) 
dax_functions_time_intelligence.htm
Advertisements