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
Advanced Time Intelligence0%
Study MaterialsCheatsheet
Power BI for AdvancedProgress 0%
1.1Quick recap of DAX, Modeling, and RLS1.2Enterprise requirements in Power BI
2.1Context Transition in DAX2.2Advanced Time Intelligence2.3Parent-Child Hierarchies
HomeTutorialsPower BI for AdvancedAdvanced Time Intelligence
Parent-Child Hierarchies

Advanced Time Intelligence

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

While standard DAX time functions (TOTALYTD, SAMEPERIODLASTYEAR) work seamlessly for standard Gregorian calendar years (January to December), large enterprises—especially in retail, hospitality, and manufacturing—operate on custom non-standard fiscal calendars:

  • 4-4-5, 4-5-4, or 5-4-4 Retail Calendars (where every quarter consists of two 4-week months and one 5-week month so that quarters always have exactly 13 weeks).
  • Custom Rolling Windows (Trailing 12 Months - T12M, 30-day moving averages).

Standard DAX time intelligence functions FAIL COMPLETELY on 4-4-5 retail calendars! Advanced BI architects author custom time intelligence patterns using pure filter manipulation.


1. Rolling Moving Averages (Trailing 30 Days / 90 Days)

A moving average smooths out daily sales volatility to reveal true underlying demand trends:

1-- 30-Day Moving Average of Sales
2Sales 30-Day Moving Avg =
3VAR LastVisibleDate = MAX(Dim_Date[Date])
4VAR DateWindow =
5 DATESINPERIOD(
6 Dim_Date[Date],
7 LastVisibleDate,
8 -30,
9 DAY
10 )
11RETURN
12CALCULATE(
13 AVERAGEX(
14 VALUES(Dim_Date[Date]),
15 [Total Sales]
16 ),
17 DateWindow
18)

2. Custom 4-4-5 Retail Calendar Year-to-Date (YTD)

In a 4-4-5 calendar, months do not align with standard date ranges. The Date table contains custom attributes: FiscalYear, FiscalWeekNumber, FiscalPeriod.

1-- Custom Fiscal YTD on 4-4-5 Calendar (Bypasses TOTALYTD!)
2Fiscal 445 Sales YTD =
3VAR CurrentFiscalYear = MAX(Dim_Date[FiscalYear])
4VAR CurrentFiscalWeek = MAX(Dim_Date[FiscalWeekNumber])
5RETURN
6CALCULATE(
7 [Total Sales],
8 ALLEXCEPT(Dim_Date, Dim_Date[FiscalYear]),
9 Dim_Date[FiscalYear] = CurrentFiscalYear,
10 Dim_Date[FiscalWeekNumber] <= CurrentFiscalWeek
11)

3. Trailing 12 Months (T12M) Revenue Pattern

Executive boards look at T12M to evaluate revenue trends independent of seasonal fluctuations:

1-- Trailing 12 Months (T12M) Sales
2Sales T12M =
3VAR LastSelectedDate = MAX(Dim_Date[Date])
4VAR FirstDateT12M = EDATE(LastSelectedDate, -12) + 1
5RETURN
6CALCULATE(
7 [Total Sales],
8 REMOVEFILTERS(Dim_Date),
9 Dim_Date[Date] >= FirstDateT12M && Dim_Date[Date] <= LastSelectedDate
10)

Interactive Quiz• Knowledge Check

Multiple Choice Questions

Question 1
Why do standard DAX time intelligence functions like TOTALYTD fail when applied to a retail 4-4-5 fiscal calendar?
Question 2
What function in DAX shifts a date backward or forward by an exact number of calendar months (e.g., subtracting 12 months for T12M)?
Question 3
In the 30-day moving average pattern, what does DATESINPERIOD(Dates, LastDate, -30, DAY) generate?
Question 4
Which DAX function completely removes all active filters from the Date table to establish an unconstrained custom date window?
Question 5
Why is a Trailing 12 Months (T12M) calculation heavily favored in financial executive reporting?

Next Lesson

Parent-Child Hierarchies

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

Related Lessons

Previous LessonNext Lesson
Context Transition in DAXParent-Child Hierarchies

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