DA0-002 Visualization and Reporting Practice Question
In Power BI, an analyst wants to create a measure that calculates the total sales for the current year up to the latest date in the data. Which DAX function should be used?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
TOTALYTD
TOTALYTD is a time intelligence function that sums values for the year up to the last date in the filter context (or specified end date).
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
SAMEPERIODLASTYEAR
Why it's wrong here
SAMEPERIODLASTYEAR shifts the date context back exactly one year, returning prior-year figures rather than a year-to-date accumulation ending at the latest data date. It is tempting because it is a time-intelligence function for year-over-year comparisons, and would be correct when the requirement is comparing current sales against the equivalent prior-year period.
- ✗
CALCULATE
Why it's wrong here
CALCULATE modifies filter context but performs no date truncation or accumulation, so it cannot itself produce a year-to-date total ending at the latest date. It is tempting because it is the core context-transition function used to wrap time-intelligence expressions, and would be correct as the outer function around a YTD measure.
- ✗
SUMX
Why it's wrong here
SUMX is an iterator that evaluates an expression row by row over a table, returning a sum but applying no date filtering, so it cannot restrict sales to the current year to date. It tempts because it aggregates sales values, and would be correct when a row-context expression must be evaluated per row before summing.
- ✓
TOTALYTD
Why this is correct
TOTALYTD aggregates a measure from the start of the year to the latest date present in the data, matching the stem's requirement for year-to-date sales. Unlike DATESYTD, which returns a date table, TOTALYTD evaluates the expression directly, producing the cumulative sales figure the analyst needs.
About these practice questions
Courseiva writes every DA0-002 question from scratch — 1,004 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DA0-002 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DA0-002 exam.