Courseiva

PL-300 Visualize and analyze the data Practice Question

You have a Power BI dataset that contains a table with sales data and a separate date table. You need to create a measure that calculates the total sales for the previous month relative to the selected date. Which DAX function should you use?

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

✓

PREVIOUSMONTH

PREVIOUSMONTH (option C) is correct because it is a time-intelligence function that returns a single-column table of dates for the entire month immediately preceding the dates in the current filter context, so wrapping it in CALCULATE with SUM of sales yields the previous month's total sales. It works directly against a marked date table and shifts the context back exactly one month, which matches the requirement. SAMEPERIODLASTYEAR shifts the context back one year, not one month, so it would return the same period last year. DATEADD shifts dates by a specified number of intervals but requires an explicit interval argument and is more general, not purpose-built for the immediately preceding month. PARALLELPERIOD shifts by a specified number of intervals and returns a full period, but it also requires an interval argument and is not the specific previous-month 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.

  • ✗

    SAMEPERIODLASTYEAR

    Why it's wrong here

    SAMEPERIODLASTYEAR is a time intelligence function that shifts the entire current filter context back exactly one year, returning the same period in the prior year (e.g., June 2024 becomes June 2023). It is designed for year-over-year comparisons, not for finding the month immediately before the current one. Therefore, if the current context is a single month, this function would incorrectly return the equivalent month from last year rather than the previous calendar month.

  • ✗

    DATEADD

    Why it's wrong here

    DATEADD shifts a set of dates by a specified number of intervals, such as DAY, MONTH, QUARTER, or YEAR, and it absolutely requires both an interval and an offset argument to function. For example, DATEADD([Date], -1, MONTH) would technically return the previous month, but the function is a generic-purpose shifting tool that demands explicit parameters and can operate at any granularity. Since the question asks for a direct function that returns the previous month based on the current context, DATEADD is less precise and would not be the natural choice for this DAX expression.

  • ✓

    PREVIOUSMONTH

    Why this is correct

    PREVIOUSMONTH is the correct answer because it is a dedicated time intelligence function that returns a table of all dates from the immediately preceding month, based on the current filter context. It automatically handles year boundaries, so when the current month is January, it correctly returns all dates in December of the prior year. This function requires a single column of contiguous dates and is typically used inside CALCULATE to apply the previous-month filter, making it the most direct and semantically accurate solution.

  • ✗

    PARALLELPERIOD

    Why it's wrong here

    PARALLELPERIOD returns a table of dates from a period that is parallel to the current selection, shifted by a specified number of intervals, but it does not specifically target the previous month unless the current period is exactly one month long. It requires both an interval and an offset parameter, and unlike PREVIOUSMONTH, it shifts the entire selected period rather than simply returning the last month. For instance, if the current context is a quarter, PARALLELPERIOD with an offset of -1 would return the prior quarter, not the previous month, making it an incorrect choice for this requirement.

About these practice questions

Courseiva writes every PL-300 question from scratch — 524 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 →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This PL-300 practice question is part of Courseiva's free Microsoft 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 PL-300 exam.