#1 Data Analytics Program in India
₹2,499₹1,499Enroll Now
Module 8
6 min read

Time Intelligence

Master time-based calculations with DAX

What You'll Learn

  • Calculate Year-to-Date (YTD)
  • Compare with last year
  • Calculate growth percentages

What is Time Intelligence?

Time Intelligence = calculations based on dates.

Time Intelligence Overview

Examples:

  • "Sales this year so far" (YTD)
  • "Sales same month last year"
  • "Growth vs last year"

Important: You Need a Date Table!

Before using time intelligence, you need a Date Table.

Calendar = CALENDAR(DATE(2020,1,1), DATE(2025,12,31))

Then: Right-click table → Mark as Date Table


YTD, MTD, QTD Functions

YTD MTD QTD

FunctionMeaningExample
TOTALYTDYear to DateJan 1 → Today
TOTALMTDMonth to DateMonth start → Today
TOTALQTDQuarter to DateQuarter start → Today

Example:

YTD Sales = TOTALYTD(SUM(Sales[Amount]), Calendar[Date])

Compare with Last Year

Use SAMEPERIODLASTYEAR to get last year's value:

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

Result: March 2024 → Shows March 2023 value


Calculate Growth %

Growth Calculation

YoY Growth =
DIVIDE(
    [Total Sales] - [Last Year Sales],
    [Last Year Sales]
)

Format as percentage in the visual!

This YearLast YearGrowth
$120,000$100,00020%

Quick Reference

NeedDAX Function
Year to DateTOTALYTD
Month to DateTOTALMTD
Last YearSAMEPERIODLASTYEAR
Last MonthDATEADD(..., -1, MONTH)
Last WeekDATEADD(..., -7, DAY)

Try This

  1. Create a Date Table
  2. Create measure: YTD Sales = TOTALYTD([Total Sales], Calendar[Date])
  3. Create measure: LY Sales = CALCULATE([Total Sales], SAMEPERIODLASTYEAR(Calendar[Date]))
  4. Create measure: Growth = DIVIDE([Total Sales] - [LY Sales], [LY Sales])
  5. Add to cards and test!

Tip: Time intelligence is super powerful for business reporting. Master these 3 patterns first!

SkillsetMaster - AI, Web Development & Data Analytics Courses