0% found this document useful (0 votes)
98 views5 pages

Time Intelligence Functions in DAX

The document discusses time-intelligence functions in DAX, which allow for data manipulation across various time periods such as days, months, and years. Key functions include TOTALYTD, DATEADD, SAMEPERIODLASTYEAR, and others, which facilitate the analysis and comparison of data over specified time frames. It emphasizes the importance of marking a date column as a Date Table before utilizing these functions.

Uploaded by

navyaragam0198
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
98 views5 pages

Time Intelligence Functions in DAX

The document discusses time-intelligence functions in DAX, which allow for data manipulation across various time periods such as days, months, and years. Key functions include TOTALYTD, DATEADD, SAMEPERIODLASTYEAR, and others, which facilitate the analysis and comparison of data over specified time frames. It emphasizes the importance of marking a date column as a Date Table before utilizing these functions.

Uploaded by

navyaragam0198
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Time Intelligence

Functions In DAX
❖ DAX includes time-intelligence functions that enable
you to manipulate data using time periods, including
days, months, quarters, and years, and then build and
compare calculations over those periods.

❖ Before using any time-intelligence functions, make


sure to mark one of the tables containing date column
as Date Table.
Time Intelligence
Functions
TOTALYTD

DATEADD

SAMEPERIODLASTYEAR

PARALLELPERIOD

PREVIOUSYEAR
➢ These functions are used for
DATEMTD
analyzing and comparing data
over time periods. DATESINPERIOD

LASTDATE

STARTOFMONTH

ENDOFYEAR

Naveen Billa
➢ TOTALYTD: Calculates a measure for a given time period,
considering the total year-to-date.
Similarly, for QTD,MTD.

TOTALYTD(SUM(financials[Sales]), ‘Calendar'[Date])
TOTALQTD(SUM(financials[Sales]), ‘Calendar'[Date])
TOTALMTD(SUM(financials[Sales]), ‘Calendar'[Date])

➢ DATESYTD: Returns a table that contains a column of the


dates for the year to date, in the current context.
Similarly, for QTD,MTD.

CALCULATE(SUM(financials[Profit]),
DATESYTD('Calendar'[Date]))
CALCULATE(SUM(financials[Profit]),
DATESQTD('Calendar'[Date]))
CALCULATE(SUM(financials[Profit]),
DATESMTD('Calendar'[Date]))
Naveen Billa
➢ DATEADD: Adds or subtracts a specified number of units
from a date.

CALCULATE(SUM(financials[Sales]),
DATEADD('Calendar'[Date],-7,DAY))

➢ PARALLELPERIOD: Returns a table that contains a column


of dates that represents a period parallel to the dates in the
specified dates column, in the current context, with the
dates shifted a few intervals either forward in time or back
in time.

CALCULATE(SUM(financials[Sales]),
PARALLELPERIOD('Calendar'[Date],-2,MONTH))

Naveen Billa
➢ PREVIOUSYEAR : Returns a table that contains a column of all
dates from the previous year, given the last date in the date's
column, in the current context. Similarly, for QTR & Month.

CALCULATE(SUM(financials[Sales]),
PREVIOUSYEAR(('Calendar'[Date])))
CALCULATE(SUM(financials[Sales]),
PREVIOUSQUARTER(('Calendar'[Date])))
CALCULATE(SUM(financials[Sales]),
PREVIOUSMONTH(('Calendar'[Date])))

➢ SAMEPERIODLASTYEAR: Retrieves data for the same period


in the previous year.

CALCULATE(SUM(financials[Sales]),
SAMEPERIODLASTYEAR(('Calendar'[Date])))

Naveen Billa

You might also like