Courseiva
Visualization and Reporting →mediumMultiple Select

DA0-002 Visualization and Reporting Practice Question

An analyst is creating a report in Power BI and needs to calculate year-to-date total sales compared to the same period last year. Which TWO DAX functions should be used? (Choose two.)

⚠ Common exam trap

The trap is confusing time intelligence functions with general aggregation functions like SUMX or FILTER, which do not handle date shifts.

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

TOTALYTD is correct because it is a time-intelligence function that evaluates an expression over the year-to-date interval, e.g., TOTALYTD(SUM(Sales[Amount]), 'Date'[Date]), which directly produces the year-to-date total sales the analyst needs. SAMEPERIODLASTYEAR is correct because it is a time-intelligence function that shifts the current date context back one year, returning the equivalent period from the prior year so the YTD figure can be compared to the same period last year. Together they satisfy the two comparison requirements in the scenario. FILTER is not a time-intelligence function; it returns a filtered table and would not by itself compute YTD or prior-year periods. RELATED is used to fetch a value from the many-side of a relationship, not for time comparisons. SUMX is an iterator that sums an expression row by row and does not handle year-to-date or prior-year logic.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    FILTER

    Why it's wrong here

    FILTER returns a table filtered by a Boolean condition and cannot by itself shift the date context. It is tempting because it is genuinely used inside CALCULATE to restrict rows, but the required year-to-date and prior-year comparisons are produced by DATESYTD and SAMEPERIODLASTYEAR, which build the date sets FILTER would otherwise need.

  • ✗

    RELATED

    Why it's wrong here

    RELATED follows an existing many-to-one relationship to fetch a value from the related table; it performs no time intelligence. It is tempting because it is genuinely needed when a fact table must pull a lookup column, but year-to-date versus prior-year comparison requires CALCULATE with DATESYTD and SAMEPERIODLASTYEAR over a marked date table.

  • ✓

    SAMEPERIODLASTYEAR

    Why this is correct

    SAMEPERIODLASTYEAR returns the equivalent date range one year prior, shifting the current filter context backwards. Combined with TOTALYTD, it supplies the prior-year comparison for the year-to-date sales measure, satisfying the requirement to compare against the same period last year.

  • ✗

    SUMX

    Why it's wrong here

    SUMX iterates a table and evaluates an expression row by row, returning an additive total with no date context. It is tempting because it is the correct choice for row-level arithmetic such as quantity multiplied by price, but shifting the filter to year-to-date and the equivalent prior-year window needs DATESYTD and SAMEPERIODLASTYEAR.

  • ✓

    TOTALYTD

    Why this is correct

    TOTALYTD evaluates an expression over the year-to-date interval, accumulating sales from the start of the year to the current date. Paired with SAMEPERIODLASTYEAR, it produces the year-to-date figure that is then compared against the prior-year equivalent.

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 →

How Courseiva writes practice questions · Editorial policy

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.