Courseiva
Visualization and ReportinghardMultiple SelectObjective-mapped

DA0-002 Visualization and Reporting Practice Question

A data analyst is creating a report in Power BI and needs to calculate the total sales for the current year and the previous year. Which TWO DAX functions can be used to retrieve 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

DATEADD

SAMEPERIODLASTYEAR and DATEADD (with -1 year) both can return dates from the previous year. PREVIOUSYEAR is invalid, TOTALYTD is for current year, and FILTER is not a time intelligence function.

Answer analysis

Option-by-option breakdown

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

  • DATEADD

    Why this is correct

    Can shift dates by -1 year to get the previous year.

  • TOTALYTD

    Why it's wrong here

    Calculates year-to-date for the current year.

  • SAMEPERIODLASTYEAR

    Why this is correct

    SAMEPERIODLASTYEAR returns a set of dates shifted exactly one year back from the current filter context, making it ideal for retrieving the previous year’s sales without manual date arithmetic. This satisfies the constraint of comparing the same time period (e.g., full year) across two consecutive years, preserving the exact day range.

  • FILTER

    Why it's wrong here

    FILTER is not a time intelligence function; it filters rows.

  • PREVIOUSYEAR

    Why it's wrong here

    Not a standard DAX function.

About these practice questions

One of 986 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 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.