By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
(For PL-300, Real Projects, and Last-Minute Exam Cramming)
Time intelligence in Power BI lets you compare data across time periods (YTD, YoY, MoM) without writing complex SQL or Excel formulas. It’s the difference between: - "Here’s last month’s sales" (a static report) - "Here’s last month’s sales vs. the same month last year, with a YTD trendline" (a decision-making tool).
Why it matters in production:- Executives don’t care about raw numbers—they care about trends. Time intelligence turns data into insights.- Manual calculations break. If you hardcode SUM(Sales[Amount]) for "last year," your report fails when the fiscal year changes or data refreshes.- Performance. Time intelligence functions are optimized in DAX—faster than filtering tables manually.
SUM(Sales[Amount])
Real-world scenario:You’re handed a Power BI report that shows "Sales by Month" as a flat table. Your CFO asks: - "How are we doing YTD vs. last year?" - "What’s the YoY growth for Q2?" - "Show me a rolling 12-month trend."
Without time intelligence, you’d spend hours writing DAX measures or (worse) exporting to Excel. With it, you solve this in 10 minutes.
TOTALYTD
, "03-31"
SAMEPERIODLASTYEAR
BLANK()
IF(ISBLANK(...), 0, ...)
DATESYTD
CALCULATE
CALCULATE(SUM(Sales[Amount]), DATESYTD('Date'[Date]))
DATEADD
-1 YEAR
+3 MONTHS
DATEADD('Date'[Date], -1, YEAR)
DATESBETWEEN
TODAY()
FIRSTDATE
LASTDATE
FIRSTDATE('Date'[Date])
FIRSTDATE(FILTER('Date', 'Date'[FiscalYear] = 2023))
PARALLELPERIOD
PARALLELPERIOD('Date'[Date], -1, YEAR)
TOTALQTD
TOTALMTD
TOTALQTD(SUM(Sales[Amount]), 'Date'[Date])
Total Sales = SUM(Sales[Amount])
Time intelligence requires a proper date table. If your data doesn’t have one, create it in Power Query:
powerquery = List.Dates(#date(2020, 1, 1), 365*5, #duration(1,0,0,0))
Column1
Date
powerquery = Table.AddColumn(#"Changed Type", "Year", each Date.Year([Date]), Int64.Type) = Table.AddColumn(#"Added Year", "Month", each Date.Month([Date]), Int64.Type) = Table.AddColumn(#"Added Month", "Quarter", each Date.QuarterOfYear([Date]), Int64.Type)
✅ Verify: Your date table should have: - A continuous range of dates (no gaps).- Columns for Year, Month, Quarter, Day of Week, etc.- No duplicates.
Year
Month
Quarter
Day of Week
Go to Modeling → New Measure and paste these:
YTD Sales = TOTALYTD( [Total Sales], // The measure to aggregate 'Date'[Date], // The date column "12-31" // Year-end date (optional; omit for calendar year) )
Why "12-31"? If your fiscal year ends in March, use "03-31".
"03-31"
PY Sales = CALCULATE( [Total Sales], SAMEPERIODLASTYEAR('Date'[Date]) )
Alternative (more flexible):
PY Sales (DATEADD) = CALCULATE( [Total Sales], DATEADD('Date'[Date], -1, YEAR) )
YoY Growth % = DIVIDE( [Total Sales] - [PY Sales], [PY Sales], 0 // Return 0 if PY Sales is blank )
Rolling 12M Sales = CALCULATE( [Total Sales], DATESBETWEEN( 'Date'[Date], DATEADD(TODAY(), -12, MONTH), TODAY() ) )
[Total Sales]
[YTD Sales]
[PY Sales]
Legend: Date[Year] (to compare years).
Add a card visual for [YoY Growth %] (format as %).
[YoY Growth %]
Add a table with:
Values: [Total Sales], [PY Sales], [YoY Growth %]
Add a slicer for Date[Year] to filter the report.
✅ Verify:- YTD sales reset at the start of each year.- PY sales align with the same dates last year.- YoY growth shows BLANK() for the first year (no prior data).
CALCULATE(SUM(...), DATESYTD(...))
Sales YTD
Total Sales YTD (Fiscal Year Ending 03-31)
VAR
dax YoY Growth % = VAR CurrentSales = [Total Sales] VAR PriorSales = [PY Sales] RETURN DIVIDE(CurrentSales - PriorSales, PriorSales, 0)
dax YoY Growth % = VAR CurrentSales = [Total Sales] VAR PriorSales = [PY Sales] RETURN IF(ISBLANK(PriorSales), BLANK(), DIVIDE(CurrentSales - PriorSales, PriorSales))
TOTALYTD([Sales], 'Date'[Date], "03-31")
∞
0
DIVIDE(..., ..., 0)
IF(ISBLANK(...), BLANK(), ...)
❌ DATEADD('Date'[Date], -1, YEAR) (returns the same dates, not the same range)
"How do you calculate YTD sales for a fiscal year ending March 31?"
❌ TOTALYTD([Sales], 'Date'[Date]) (defaults to Dec 31)
TOTALYTD([Sales], 'Date'[Date])
"What’s the difference between DATESYTD and TOTALYTD?"
TOTALYTD returns a scalar value (a measure).
"How do you calculate a rolling 3-month average?"
dax Rolling 3M Avg = AVERAGEX( DATESINPERIOD('Date'[Date], MAX('Date'[Date]), -3, MONTH), [Total Sales] )
AVERAGE([Total Sales])
Challenge:You have a table Sales with columns Date and Amount. Write a measure that shows: - YTD sales for the current fiscal year (ending June 30).- Prior fiscal year YTD sales.- YoY growth % (handle BLANK() values).
Sales
Amount
Solution:
// Fiscal YTD Sales (ending June 30) Fiscal YTD Sales = TOTALYTD( SUM(Sales[Amount]), 'Date'[Date], "06-30" ) // Prior Fiscal YTD Sales Prior Fiscal YTD Sales = CALCULATE( [Fiscal YTD Sales], DATEADD('Date'[Date], -1, YEAR) ) // YoY Growth % Fiscal YoY Growth % = VAR CurrentYTD = [Fiscal YTD Sales] VAR PriorYTD = [Prior Fiscal YTD Sales] RETURN IF( ISBLANK(PriorYTD), BLANK(), DIVIDE(CurrentYTD - PriorYTD, PriorYTD) )
Why it works:- TOTALYTD with "06-30" ensures the fiscal year resets on June 30.- DATEADD shifts the date by 1 year to get the prior fiscal YTD.- IF(ISBLANK(...), BLANK(), ...) handles cases where prior year data doesn’t exist.
"06-30"
CALCULATE([Sales], SAMEPERIODLASTYEAR('Date'[Date]))
DIVIDE([Sales] - [PY Sales], [PY Sales], 0)
CALCULATE([Sales], DATESBETWEEN('Date'[Date], DATEADD(TODAY(), -12, MONTH), TODAY()))
TOTALQTD([Sales], 'Date'[Date])
TOTALMTD([Sales], 'Date'[Date])
CALCULATE([Sales], DATEADD('Date'[Date], -1, YEAR))
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.