MSK Institute LogoMSK.Institute
HomeCourses
Book Free Demo➔Sign In
Free Demo➔
MSK Institute LogoMSK.Institute

Leading computer training academy in Shikohabad for software engineering, Python, web development, and digital literacy.

ISO 9001:2015 Certified Center
Follow & Connect
4.9

Programs & Admissions

  • All CoursesCatalog
  • Learning PathsRoadmaps
  • Student ProjectsShowcase
  • Live Classes & ScheduleLive
  • Upcoming Batches
  • Campuses & LocationsHub
  • Verify Certificates
  • Book Free Demo Class

Resources & Tools

  • Free Online Mock TestsAll Tests
  • NIELIT CCC Mock TestFree
  • Course & Career FinderQuiz
  • Study Material Hub
  • All MSK ToolsHub
  • Keyboard ShortcutsNew
  • TypeQuest Speed LabTyping
  • MSK Code PlaygroundCode
  • Interactive Tutorials
  • Quick Cheatsheets

Institute & Contact

  • About MSK Institute
  • Careers & InternshipsHiring
  • Publications & Blogs
  • Gali No. 3, Near Gyan Jyoti Public School,
    Adarsh Nagar, Shikohabad, Uttar Pradesh 283135
  • +91 83930 42166
  • mskshikohabad@gmail.com
  • Hours:Mon – Sat: 8:00 AM – 7:00 PM | Sun: 10:00 AM – 2:00 PM
  • 4.9 ★(38 Google Reviews)
© 2026 MSK Institute. All rights reserved.•Privacy Policy•Terms of Service•Disclaimer•Contact Us

Shikohabad's Leading Computer & Coding Academy

Home
Courses
Live
Material
Time Intelligence Functions0%
Study MaterialsCheatsheet
Power BI for IntermediateProgress 0%
1.1Quick recap of Import, Modeling, DAX1.2Project requirements for Intermediate Level
2.1Time Intelligence Functions2.2Iterators (SUMX, AVERAGEX)2.3CALCULATE and FILTER Functions
HomeTutorialsPower BI for IntermediateTime Intelligence Functions
Iterators (SUMX, AVERAGEX)

Time Intelligence Functions

Beginner12 min read•Updated: 2026-11-18•By Er. Sumit Kumar (MSK Institute)
Study MaterialsCheatsheet

Time Intelligence calculations are among the most frequent requirements in business reporting. Executives need to compare current sales against prior months, calculate fiscal year-to-date figures, and analyze Year-over-Year (YoY) percentage growth.


1. The Date Table Prerequisite (Golden Rule)

CRITICAL RULE: For DAX Time Intelligence functions (TOTALYTD, SAMEPERIODLASTYEAR, DATEADD) to work accurately, your model MUST contain a dedicated Calendar / Date Table that fulfills these four strict criteria: 1. It must contain a column of data type Date with continuous dates (no missing days). 2. It must span full years covering all transaction dates in your fact tables. 3. It must be marked as an official Date Table (Mark as Date Table in Power BI Desktop). 4. It must connect to your Fact table via a 1-to-Many ($1 : *$) relationship.

Generating a Calendar Table in DAX

1Dim_Date =
2VAR MinYear = YEAR(MIN(Fact_Sales[OrderDate]))
3VAR MaxYear = YEAR(MAX(Fact_Sales[OrderDate]))
4RETURN
5ADDCOLUMNS(
6 CALENDAR(DATE(MinYear, 1, 1), DATE(MaxYear, 12, 31)),
7 "Year", YEAR([Date]),
8 "MonthNumber", MONTH([Date]),
9 "MonthName", FORMAT([Date], "MMMM"),
10 "YearMonth", FORMAT([Date], "YYYY-MM"),
11 "Quarter", "Q" & FORMAT([Date], "Q"),
12 "DayOfWeek", FORMAT([Date], "dddd")
13)

2. Cumulative Period Functions: YTD, QTD, MTD

Cumulative functions aggregate values from the beginning of a period up to the current date in context:

Syntax & Implementations

1-- 1. Year-To-Date (YTD) Sales
2Sales YTD =
3TOTALYTD(
4 [Total Sales],
5 Dim_Date[Date]
6)
7 
8-- 2. Quarter-To-Date (QTD) Sales
9Sales QTD =
10TOTALQTD(
11 [Total Sales],
12 Dim_Date[Date]
13)
14 
15-- 3. Month-To-Date (MTD) Sales
16Sales MTD =
17TOTALMTD(
18 [Total Sales],
19 Dim_Date[Date]
20)

3. Prior Period Comparisons & Year-over-Year (YoY)

Comparing metrics against historical benchmarks is straightforward using SAMEPERIODLASTYEAR and DATEADD.

1-- Prior Year Sales (Same Period Last Year)
2Sales Prior Year =
3CALCULATE(
4 [Total Sales],
5 SAMEPERIODLASTYEAR(Dim_Date[Date])
6)
7 
8-- Year-over-Year (YoY) Sales Variance Amount
9Sales YoY Variance =
10[Total Sales] - [Sales Prior Year]
11 
12-- Year-over-Year (YoY) Growth Percentage
13Sales YoY Growth % =
14DIVIDE(
15 [Sales YoY Variance],
16 [Sales Prior Year],
17 0
18)

4. Custom Shifts with DATEADD

While SAMEPERIODLASTYEAR shifts dates back by exactly 1 year, DATEADD offers full flexibility:

1-- Prior Month Sales
2Sales Prior Month =
3CALCULATE(
4 [Total Sales],
5 DATEADD(Dim_Date[Date], -1, MONTH)
6)
7 
8-- Prior Quarter Sales
9Sales Prior Quarter =
10CALCULATE(
11 [Total Sales],
12 DATEADD(Dim_Date[Date], -1, QUARTER)
13)

Interactive Quiz• Knowledge Check

Multiple Choice Questions

Question 1
Which mandatory requirement must be satisfied for DAX Time Intelligence functions to calculate correctly?
Question 2
If a company's fiscal year starts on April 1st instead of January 1st, how do you adjust TOTALYTD?
Question 3
What is the difference between SAMEPERIODLASTYEAR(DateCol) and DATEADD(DateCol, -1, YEAR)?
Question 4
What does the DAX measure [Total Sales] - CALCULATE([Total Sales], SAMEPERIODLASTYEAR(Dim_Date[Date])) compute?
Question 5
Why should you use DIVIDE([YoY Variance], [Sales Prior Year], 0) rather than the standard / division operator?

Next Lesson

Iterators (SUMX, AVERAGEX)

Continue learning with hands-on practice, examples, and exercises in the upcoming topic.

Related Lessons

Previous LessonNext Lesson
Project requirements for Intermediate LevelIterators (SUMX, AVERAGEX)

Practice Quiz

Test your understanding of this lesson with 5 questions. Each question has one correct answer.

12-Month Data Analysis Mastery Program

Master Full-Stack Data Analytics (Excel, SQL, Python, Power BI & Tableau)

Combine 15 complete courses, 150 chapters, 541 topics, live SQL/Power BI/Tableau dashboards, and Scikit-Learn capstones at MSK Institute Shikohabad or Live Online.

View Full CourseBook Free Demo
PreviousNext
PreviousPrevNext