

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: DAX
incomplete
2: Logical Functions – IF
incomplete
3: SWITCH Function
incomplete
4: Time Intelligence Functions
incomplete
5: More Time Functions
incomplete
6: Add Columns
incomplete
7: Aggregations
incomplete
8: Aggregations As Measures
incomplete
9: Iterators
incomplete
10: Calculated Columns vs. Measures
incomplete
11: Context in DAX
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Before we move on, it's worth mentioning some other particularly useful time functions:
TOTALYTD: Calculates year-to-date values. Useful for tracking annual performance and cumulative growth.DATEADD: Shifts the date context by a number of days, months, quarters, or years. Perfect for week-over-week or month-over-month comparisons.DATESINPERIOD: Returns a rolling range of dates. Essential for things like rolling 7-day, 30-day, or 90-day performance.DATEDIFF: Calculates the difference between two dates in days, months, or years. Great for calculating age, tenure, or time to complete tasks.DATE: Creates a date from year, month, and day values. Useful for constructing specific dates in your data model.TODAY: Returns the current date. Handy for dynamic reports that need to show today's data.If you learn these, you can build almost every core time-based metric.
For a more complete list, check the docs here.
num_sales_in_2026 =
CALCULATE (
SUM ( sales[quantity] ),
DATESINPERIOD ( dates[date], DATE( 2026, 01, 01 ), 1, YEAR )
)
dates[date] is a reference to a column containing date values that have a relationship that ties back to our salesDATE( 2026, 01, 01 ) is the start date1 is the number of intervalsYEAR is the interval durationUse CALCULATE with [total_revenue] as its first argument – measures are referenced directly, not wrapped in SUM().
Save the project and, from the course directory, submit the CLI tests.