Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

3.9 Advanced Time Intelligence Functions

Lesson 30 of 62 in the free Power BI notes on Siksha Sarovar, written by Rohit Jangra.

Advanced Time Intelligence Functions

Time intelligence functions allow you to compare data across time periods — a core requirement in business reporting.

Pre-requisites for Time Intelligence

  1. A dedicated Date table must exist in the model
  2. The Date table must have a column marked as the Date column
  3. The Date table must contain continuous dates (no gaps)
  4. The Date table must be related to the fact table

Creating a Date Table:

DateTable =
ADDCOLUMNS(
    CALENDAR(DATE(2020,1,1), DATE(2025,12,31)),
    "Year", YEAR([Date]),
    "Month", MONTH([Date]),
    "MonthName", FORMAT([Date], "MMMM"),
    "Quarter", "Q" & FORMAT([Date], "Q"),
    "Day", DAY([Date]),
    "Weekday", FORMAT([Date], "dddd")
)

SAMEPERIODLASTYEAR()

Returns the same dates from the previous year.

Syntax: SAMEPERIODLASTYEAR(Dates)

Example:

Sales Last Year = CALCULATE([Total Sales], SAMEPERIODLASTYEAR(Dates[Date]))

Year-Over-Year Growth:

YoY Growth =
VAR CurrentYear = [Total Sales]
VAR LastYear = CALCULATE([Total Sales], SAMEPERIODLASTYEAR(Dates[Date]))
RETURN
DIVIDE(CurrentYear - LastYear, LastYear)

PARALLELPERIOD()

Returns a set of dates shifted by a specified number of intervals.

Syntax: PARALLELPERIOD(Dates, NumberOfIntervals, Interval)

Examples:

Sales Last Quarter = CALCULATE([Total Sales], PARALLELPERIOD(Dates[Date], -1, QUARTER))
Sales Two Years Ago = CALCULATE([Total Sales], PARALLELPERIOD(Dates[Date], -2, YEAR))

YTD, MTD, QTD — Period-to-Date Functions

These functions calculate cumulative totals from the start of the period to the current date.

FunctionDescription
TOTALYTD()Year-to-Date total
TOTALMTD()Month-to-Date total
TOTALQTD()Quarter-to-Date total
DATESYTD()Returns YTD dates (use inside CALCULATE)
DATESMTD()Returns MTD dates
DATESQTD()Returns QTD dates

Examples:

YTD Sales = TOTALYTD([Total Sales], Dates[Date])
MTD Sales = TOTALMTD([Total Sales], Dates[Date])
QTD Sales = TOTALQTD([Total Sales], Dates[Date])

Using CALCULATE + DATESYTD (alternative approach):

YTD Sales = CALCULATE([Total Sales], DATESYTD(Dates[Date]))

PREVIOUSMONTH(), PREVIOUSQUARTER(), PREVIOUSYEAR()

FunctionReturns
PREVIOUSMONTH()Dates from the previous month
PREVIOUSQUARTER()Dates from the previous quarter
PREVIOUSYEAR()Dates from the previous year
NEXTMONTH()Dates from the next month
NEXTQUARTER()Dates from the next quarter
NEXTYEAR()Dates from the next year

Example:

Previous Month Sales = CALCULATE([Total Sales], PREVIOUSMONTH(Dates[Date]))

Time Intelligence Summary Table

FunctionPurposeExample
SAMEPERIODLASTYEAR()Same period, last yearYoY comparison
PARALLELPERIOD()Shift by N intervalsQoQ, custom periods
TOTALYTD()Cumulative year totalRunning YTD revenue
TOTALMTD()Cumulative month totalMTD performance
TOTALQTD()Cumulative quarter totalQTD tracking
PREVIOUSMONTH()Previous month datesMonth-over-month
DATEADD()Flexible date shiftAny period comparison