fx Power Pivot & DAX Intro

Time intelligence: YTD, MTD, same period last year

⏱ 15 min

What you'll learn

  • Requirements (don't skip)
  • Year-to-date (Indian FY)
  • Month-to-date

Concept

1. Requirements (don't skip)

  1. A Calendar table with every date, no gaps, covering all years in your data (Lesson 1).
  2. It's marked as Date Table.
  3. fact_Sales[OrderDate] → Calendar[Date] relationship.
  4. Pivots use Calendar fields (FY, Month), never the fact table's date.

Break any of these and time functions return blanks or wrong numbers.

2. Year-to-date (Indian FY)

Revenue YTD := TOTALYTD([Total Revenue], 'Calendar'[Date], "3/31")

The third argument is the year-end date: "3/31" = 31 March, so the year restarts every April. Without it, YTD restarts in January.

Pivot: Rows = FY, Month (Calendar). At September 2025, Revenue YTD = 12,68,13,258 (April–September). At March 2026 it reaches the full-year 29,49,96,410.

Quarter-to-date: TOTALQTD([Total Revenue], 'Calendar'[Date]) (calendar quarters).

3. Month-to-date

Revenue MTD := TOTALMTD([Total Revenue], 'Calendar'[Date])

Useful with Date in Rows (day level) or a daily dashboard: "sales so far this month".

4. Same period last year

Revenue LY := CALCULATE([Total Revenue], SAMEPERIODLASTYEAR('Calendar'[Date]))
YoY Growth := [Total Revenue] - [Revenue LY]
YoY %      := DIVIDE([Total Revenue] - [Revenue LY], [Revenue LY])

SAMEPERIODLASTYEAR shifts the cell's dates back one year — the same month, quarter or FY.

Cell Revenue Revenue LY YoY %
Oct 2025 3,60,09,313 3,05,31,900 +17.9%
FY2025-26 29,49,96,410 26,56,58,820 +11.0%

5. YTD vs last year's YTD

Revenue YTD LY := CALCULATE([Revenue YTD], SAMEPERIODLASTYEAR('Calendar'[Date]))
YTD Growth %   := DIVIDE([Revenue YTD] - [Revenue YTD LY], [Revenue YTD LY])

At September 2025: YTD 12,68,13,258 vs last year's YTD 11,60,23,245 → +9.3%. This is the number management usually asks for in mid-year reviews.

6. Previous month (for MoM)

Revenue PM := CALCULATE([Total Revenue], DATEADD('Calendar'[Date], -1, MONTH))
MoM %      := DIVIDE([Total Revenue] - [Revenue PM], [Revenue PM])

DATEADD shifts by any number of days, months, quarters or years. (KPI meaning of MoM/YoY in Module 7.)

7. Watch out

  • Partial periods: if data ends on 15 October, "Oct YoY" compares half a month with a full month. Show the last complete month, or compare MTD with MTD LY.
  • Calendar too long: a Calendar running to December 2026 makes YTD show flat future months — filter the pivot to dates with data, or end the Calendar at the last data date.
  • First year: LY measures are blank for FY2024-25 (no earlier data) — that's correct, not a bug.

8. The core measure set (copy into every model)

Total Revenue, Total Cost, Profit, Margin %, Orders, Avg Order Value, Revenue YTD, Revenue LY, YoY %, Revenue YTD LY, YTD Growth %, Revenue PM, MoM %. With these, most monthly business reviews are a pivot and two slicers.

Common mistakes

Missing "3/31" (YTD resets in January). Using the fact table's date in pivots. Calendar not marked or with gaps. Comparing a partial current month with a full last-year month.

Exercises

mediumAdd every measure from section 8 to your capstone model. Build a pivot: Rows = Calendar FY and Month; Values = Total Revenue, Revenue YTD, Revenue LY, YoY %, YTD Growth %. Check: Oct 2025 YoY +17.9%; YTD at Sep 2025 +9.3%; FY2025-26 YoY +11.0%.
Use Calendar fields and March 31 fiscal year end. Sep 2025 YTD 126813257.50 vs 116023245 gives 9.2999% growth; Oct revenue 36009312.50 vs 30531900 gives 17.9400% YoY. March YTD equals 294996410; full-FY YoY is 11.0433%. Format only the display, not source values.

Quiz

What does "3/31" in TOTALYTD do?
Sets the year-end to 31 March, for an Apr–Mar FY
Function for "same period last year"?
SAMEPERIODLASTYEAR, inside CALCULATE
Why must pivots use Calendar fields?
Time functions work through the marked Date table
Time intelligence: YTD, MTD, same period last year · Analysis & Visualization | ExcelWalaa