Enhance your understanding of DAX time intelligence functions with this focused quiz. Learn to identify key functions and their applications in calculating dates, periods, and time-based metrics.
Which DAX function is specifically designed to calculate the running total of a value from the beginning of the year to the current date?
Explanation: The TOTALYTD function is used to compute the cumulative value since the start of the year up to a specified date. DATESBETWEEN returns a table of dates between two specified dates and does not perform aggregation itself. STARTOFYEAR only provides the first date of a year based on a date column, not any totals. DATEADD shifts dates forward or backward but does not provide year-to-date totals.
Which DAX function calculates the cumulative total of a value starting from the first day of a month to a given date within that month?
Explanation: TOTALMTD computes the running total from the start of a month to a specific date. DATESINPERIOD returns a set of dates rather than a total. PARALLELPERIOD shifts dates by a given period but does not sum values. ENDOFMONTH finds the last date in a month, not the cumulative total.
If you need to sum values from the beginning of the current quarter up to today, which function should you use?
Explanation: TOTALQTD provides the running total for a quarter up to a specific date, making it the correct choice. NEXTQUARTER returns dates in the subsequent quarter but doesn't sum values. QUARTER is not a valid DAX time intelligence function, and EARLIER is used in row contexts, unrelated to time period calculations.
To get the value that occurred in the month before the selected date, which DAX function should be used?
Explanation: PREVIOUSMONTH returns a table of dates from the month immediately preceding the current selection. SAMEPERIODLASTYEAR returns a parallel period from the previous year, not month. NEXTMONTH gives dates from the upcoming month. PREVIOUSYEAR focuses on last year's period instead of the previous month.
Which function shifts a set of dates backward or forward by a specified interval, such as moving data three months ahead?
Explanation: DATEADD adjusts dates by a given interval, making it ideal for moving data forward or backward in time. FIRSTDATE returns just the earliest date, not a shifted range. CALENDAR creates a list of sequential dates between two values. DATESYTD lists year-to-date dates but does not shift them.
Which DAX function should you use to find the earliest date in a column for the current year context?
Explanation: STARTOFYEAR gives the first date in the current year context from a date column. LASTDATE returns the most recent date, not the first. STARTOFMONTH finds the first date of the current month. ENDOFYEAR provides the last date of the year rather than the first.
Which function generates a single-column table of dates between two specified dates?
Explanation: CALENDAR generates a contiguous range of dates between the given start and end dates. TODAY returns the current date as a single value, not a table. WEEKNUM finds the week number for a date. NOW gives the current date and time, also not a date table.
If you need to compare sales from the same quarter last year to the current quarter, which function helps retrieve the matching period a year earlier?
Explanation: SAMEPERIODLASTYEAR returns a table of dates from the matching period one year earlier. PREVIOUSMONTH brings in dates from the previous month, not the same period last year. DATEVALUE converts strings to dates, not periods. NEXTYEAR focuses on future dates, not past parallel periods.
Which function returns the dates from the current selection up to the current date within a year for cumulative calculations?
Explanation: DATESYTD gives all dates from the start of the year up to the current date within that context, aiding in cumulative metrics. DATESINPERIOD returns a custom range but isn't tailored for year-to-date. LASTDATE finds only the last date. DATESMTD is specifically for month-to-date, not year.
Which DAX function helps produce a table of dates within a specified number of days, months, or years before or after a given date?
Explanation: DATESINPERIOD constructs a table of dates for a dynamic period before or after a starting date, which is useful for rolling metrics. EDATE calculates a date offset by a certain number of months but doesn't build a table of dates. CALENDARAUTO auto-generates date tables for the model, not custom periods. PREVIOUSQUARTER returns dates from the last quarter, not a rolling period based on a specified length.