DA0-002 Visualization and Reporting Practice Question
A BI analyst is creating a report in Power BI and needs to calculate the total sales for the current year compared to the previous year. Which DAX function should be used to calculate the previous year's sales?
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 returns a set of dates in the previous year for the same period, which is ideal for year-over-year comparisons.
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 this is correct
SAMEPERIODLASTYEAR is a time intelligence function that shifts the current filter context back exactly one year, returning the prior-year equivalent period. It satisfies the year-over-year comparison requirement by operating on a marked date table, so the previous year's sales total aligns correctly with the current year's.
- ✗
PREVIOUSYEAR
Why it's wrong here
PREVIOUSYEAR returns the entire prior year's total, not the equivalent period shifted back, so a year-to-date comparison misaligns. It tempts for full-year-over-full-year reporting. DATEADD or SAMEPERIODLASTYEAR shifts the exact date range, matching the stem's comparison.
- ✗
TOTALYTD
Why it's wrong here
TOTALYTD accumulates the current year's sales from the year start to the current date, giving a year-to-date running total rather than the previous year's figure. It is tempting because it is the standard function for year-to-date reporting, which is the correct choice when the requirement is cumulative current-year performance.
- ✗
DATEADD
Why it's wrong here
DATEADD shifts a date column by a specified interval but returns dates, not the prior-year sales total, so it needs wrapping in CALCULATE with a filter. It is tempting because it handles arbitrary offsets such as three months back, which suits rolling comparisons rather than fixed year-over-year reporting.
Go deeper
Related to this question
About these practice questions
One of 1,004 original DA0-002 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.