DA0-002 Visualization and Reporting Practice Question
In Power BI, a developer needs to create a measure that calculates total sales for the same period last year. Which DAX function should be used?
⚠ Common exam trap
DA0-002 often tests the confusion between time intelligence functions, tricking candidates into choosing TOTALYTD or DATEADD when the question specifically asks for same period last year.
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
✓
SAMEPERIODLASTYEAR
SAMEPERIODLASTYEAR is a DAX time intelligence function that returns a table of dates shifted back exactly one year, ideal for year-over-year comparisons. It is specifically designed for calculating metrics like total sales for the same period last year when used with a date table. This function is simple and directly addresses the requirement.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
TOTALYTD
Why it's wrong here
TOTALYTD aggregates a year-to-date running total from the year's start to the current date, so it cannot return the equivalent prior-year period. It is tempting because it handles time intelligence and calendar boundaries, and would be correct for cumulative annual reporting such as year-to-date revenue against target.
- ✗
PARALLELPERIOD
Why it's wrong here
PARALLELPERIOD shifts the entire current filter context by whole intervals, so it returns a period offset from the visible dates rather than the equivalent prior-year period aligned to the current selection. It suits comparing complete quarters or months across a fixed interval offset.
- ✗
DATEADD
Why it's wrong here
DATEADD shifts the date filter by a specified number of intervals, so it moves the current period rather than returning the same period one year earlier as a standalone value. It suits flexible period-shift calculations where the offset is parameterised.
- ✓
SAMEPERIODLASTYEAR
Why this is correct
SAMEPERIODLASTYEAR returns a table of dates shifted back exactly one year, which the measure then evaluates against, satisfying the year-over-year comparison. It requires a marked date table, unlike DATEADD, which shifts by an arbitrary interval.
Go deeper
Related to this question
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 and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official CompTIA exam blueprint
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.