Use DAX time intelligence functions in Power BI Desktop models
DAX Functions which summarize over a time
One group of DAX time intelligence functions is concerned with summarizations over time:
DATESYTD DAX function -
Returns a single-column table that contains dates for the year-to-date (YTD) in the current filter context. This group also includes the DATESMTD and DATESQTD DAX functions for month-to-date (MTD) and quarter-to-date (QTD). You can pass these functions as filters into the CALCULATE DAX function.
TOTALYTD DAX function -
Evaluates an expression for YTD in the current filter context. The equivalent QTD and MTD DAX functions of TOTALQTD and TOTALMTD are also included.
DATESBETWEEN DAX function -
Returns a table that contains a column of dates that begins with a given start date and continues until a given end date.
DATESINPERIOD DAX function -
Returns a table that contains a column of dates that begins with a given start date and continues for the specified number of intervals.
DAX Functions which Comparisons over time
Another group of DAX time intelligence functions is concerned with shifting time periods:
DATEADD DAX function -
Returns a table that contains a column of dates, shifted either forward or backward in time by the specified number of intervals from the dates in the current filter context.
PARALLELPERIOD DAX function -
Returns a table that contains a column of dates that represents a period that is parallel to the dates in the specified dates column, in the current filter context, with the dates shifted a number of intervals either forward in time or back in time.
SAMEPERIODLASTYEAR DAX function -
Returns a table that contains a column of dates that are shifted one year back in time from the dates in the specified dates column, in the current filter context.
Many helper DAX functions for navigating backward or forward for specific time periods, all of which returns a table of dates. These helper functions include NEXTDAY, NEXTMONTH, NEXTQUARTER, NEXTYEAR, and PREVIOUSDAY, PREVIOUSMONTH, PREVIOUSQUARTER, and PREVIOUSYEAR.
Comments
Post a Comment