DAX - Time Intelligence Flashcards
What do time intelligence functions do?
Enable you to manipulate data using time periods, including days, months, quarters, and years, and then build and compare calculations over those periods.
They are particularly useful for trend analysis, forecasting, and performance comparison.
What are the two types of time intelligence functions?
- Functions that returns a scalar value without requiring CALCULATE
- Functions that returns a table, which has to be used as a filter in a CALCULATE statement
What is required for time intelligence functions to work correctly?
A date dimension table with a column of dates.
What are time-related dimensions?
- Date
- Weeks
- Months
- Quarters
- Years
- Annual Periods
- YTD
- Etc
Benefits of time intelligence
- Identifying trends
- Forecasting and predictive analysis
- Real-time performance monitoring
- Compariative analysis (example year over year)
- Sales and marketing optimization
What are the three classifications of time intelligence?
- Time Comparison Functions
- Aggregate Functions
- Information Functions
What does a Time Comparison Function do?
Compares one date or time to another.
For instance, comparing total revenue with the revenue from the last quarter.
What do aggregate time intelligence functions do?
Show the year-to-date, month-to-date or anything similar.
What do information functions do?
Provide snapshots of information
Like a month-opening or year-end balance. These functions are especially important in financial management.
What does summarizing data over time mean?
Identifying trends, patterns, and anomalies in performance over a specific period.
Examples
Sales per Quarter
Annual Growth
TOTALYTD syntax
TOTALYTD(expression, DateColumn, filter, YearEndDate)
Filter and YearEndDate are optional arguments
You MUST have a date dimension table with a column of dates for time intelligence functions to work correctly.
TOTALYTD example
Sales_YTD=
TOTALYTD(
SUM(Sales[Total Sales]), //Sum total sales
Sales[OrderDate].[Date] //Field to use for the date
)
You MUST have a date dimension table with a column of dates for time intelligence functions to work correctly.
How does TOTALYTD work?
It returns the desired expression, for example SUM(Sales), from January 1 to the specified date of the current year.
DATESYTD syntax
DATESYTD(DateColumn, YearEndDate)
YearEndDate is an optional argument. The DateColumn is the column you want to use to calculate YTD
You MUST have a date dimension table with a column of dates for time intelligence functions to work correctly.
How does DATESYTD work?
- It returns a single column table that has dates for the year to date in the current filter context.
What is a good scenario in which to use TOTALYTD?
When you need running totals
What are two other functions that work similarly to DATESYTD?
- DATESMTD
- DATESQTD