You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: query-languages/dax/calendarauto-function-dax.md
+13-3Lines changed: 13 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -38,8 +38,18 @@ Returns a table with a single column named "Date" that contains a contiguous set
38
38
39
39
## Example
40
40
41
-
In this example, the MinDate and MaxDate in the data model are July 1, 2010 and June 30, 2011.
41
+
In this example, the MinDate and MaxDate in the data model are July 1, 2018 and June 30, 2019. This model contains two calculated tables:
42
42
43
-
`CALENDARAUTO()` will return all dates between January 1, 2010 and December 31, 2011.
43
+
-**CalendarAuto**. Defined as `CALENDARAUTO()`. Returns all dates between January 1, 2018 and December 31, 2019.
44
+
-**CalendarAuto3**. Defined as `CALENDARAUTO(3)`. Returns all dates between April 1, 2018 and March 31, 2020. As in this example `fiscal_year_end_month` is 3, the first years starts on April 1st and ends on March 31st. As a result, the range is determined by selecting the first day of the fiscal year on or before the MinDate's year (April 1, 2018) and the last day of the fiscal year after or within the MaxDate's year (March 31, 2020).
44
45
45
-
`CALENDARAUTO(3)` will return all dates between April 1, 2010 and March 31, 2012. As in this example `fiscal_year_end_month` is 3, the first years starts on April 1st and ends on March 31st. As a result, the range is determined by selecting the first day of the fiscal year on or before the MinDate's year (April 1, 2010) and the last day of the fiscal year after or within the MaxDate's year (March 31, 2012).
46
+
Below are measure definitions and their return values on the example model:
47
+
48
+
```dax
49
+
MinDate = MIN('Date'[Date]) //returns July 1, 2018
50
+
MaxDate = MAX('Date'[Date]) //returns June 30, 2019
51
+
MinCalendarAuto = MIN('CalendarAuto'[Date]) //returns January 1, 2018
52
+
MaxCalendarAuto = MAX('CalendarAuto'[Date]) //returns December 31, 2019
53
+
MinCalendarAuto3 = MIN('CalendarAuto3'[Date]) //returns April 1, 2018
54
+
MaxCalendarAuto3 = MAX('CalendarAuto3'[Date]) //returns March 31, 2020
0 commit comments