Tuesday, April 21, 2020

DIFFERENCE BETWEEN CALENDAR AND CALENDARAUTO


CALENDAR FUNCTION



Syntax
CALENDAR(<start_date>, <end_date>)  
Examples

The following formula returns a table with dates between January 1st, 2005 and December 31st, 2015.
=CALENDAR (DATE (2005, 1, 1), DATE (2015, 12, 31))
For a data model which includes actual sales data and future sales forecasts. The following expression returns the date table covering the range of dates in these two tables.
=CALENDAR (MINX (Sales, [Date]), MAXX (Forecast, [Date]))

CALENDERAUTO FUNCTION

 CALENDARAUTO  automatically finds the minimum and maximum year of all the date columns included across the whole data model, and generates all the dates included between these years.

Example

In this example, the MinDate and MaxDate in the data model are July 1, 2010 and June 30, 2011.
CALENDARAUTO() will return all dates between January 1, 2010 and December 31, 2011.
CALENDARAUTO(3) will return all dates between March 1, 2010 and February 28, 2012.

No comments:

Post a Comment

Sort by Month and year in the table

  Solved: Sort by month in Power BI - Microsoft Power BI Community