Question 239 of 966
Model the dataeasyMultiple ChoiceObjective-mapped

Quick Answer

The correct DAX expression is CALCULATE(SUM(Sales[Revenue]), DATEDIFF(Sales[OrderDate], Sales[ShipDate], DAY) <= 7). This works because CALCULATE transitions the row context into a filter context, allowing the DATEDIFF function to evaluate the day difference between OrderDate and ShipDate for each row, and the `<= 7` condition isolates only those shipments completed within a week. On the Microsoft Power BI Data Analyst PL-300 exam, this tests your ability to combine filter modification with time intelligence—a common scenario when you need to calculate revenue shipped within 7 days for operational reporting. A frequent trap is forgetting that CALCULATE is required to apply the filter; a simple SUM with a FILTER or a calculated column would not work as a measure. To remember, think: "CALCULATE changes the context, DATEDIFF counts the gap, and `<= 7` keeps it tight."

PL-300 Model the data Practice Question

This PL-300 practice question tests your understanding of model the data. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

A company has a Power BI semantic model with a table named 'Sales' that contains columns: OrderDate, ShipDate, Quantity, and Revenue. The company wants to create a measure that calculates the total revenue for orders shipped within 7 days of the order date. Which DAX expression should be used?

Question 1easymultiple choice
Full question →

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

CALCULATE(SUM(Sales[Revenue]), DATEDIFF(Sales[OrderDate], Sales[ShipDate], DAY) <= 7)

Option A is correct because it uses CALCULATE to modify the filter context, applying a filter condition that uses DATEDIFF to compute the number of days between OrderDate and ShipDate. The condition `<= 7` correctly identifies orders shipped within 7 days, and SUM aggregates the Revenue column under that filtered context.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

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

  • CALCULATE(SUM(Sales[Revenue]), DATEDIFF(Sales[OrderDate], Sales[ShipDate], DAY) <= 7)

    Why this is correct

    This correctly uses CALCULATE with a filter that uses DATEDIFF to compare each row's dates.

    Related concept

    Read the scenario before looking for a memorised answer.

  • SUMX(FILTER(Sales, Sales[ShipDate] - Sales[OrderDate] <= 7), Sales[Revenue])

    Why it's wrong here

    SUMX with FILTER is syntactically correct, but using date subtraction may cause data type issues; DATEDIFF is preferred.

  • CALCULATE(SUM(Sales[Revenue]), DATEDIFF(Sales[OrderDate], Sales[ShipDate], DAY) <= 7)

    Why it's wrong here

    DATEDIFF does not work with row context; it requires a scalar value.

  • CALCULATE(SUM(Sales[Revenue]), Sales[ShipDate] - Sales[OrderDate] <= 7)

    Why it's wrong here

    Subtracting dates returns a duration, but this syntax is not valid for filtering in CALCULATE.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates often assume direct date subtraction works the same in DAX as in Excel or SQL, but DAX treats date subtraction as a datetime operation, not a simple day count, leading to incorrect results or errors.

Detailed technical explanation

How to think about this question

The DATEDIFF function in DAX returns a whole number representing the interval between two dates in the specified unit (e.g., DAY). Direct subtraction of two date columns in DAX returns a decimal number representing the difference in days, but this is not reliable for row-context filtering because it may produce unexpected results due to time components. Using DATEDIFF ensures consistent integer comparison and is the recommended approach for date difference calculations in measures.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

An e-commerce site experiences heavy traffic on Black Friday and near-zero traffic during off-peak weeks. Rather than provisioning permanent large VMs, the team uses auto-scaling groups that add capacity automatically under load and reduce it overnight. Questions like this test whether you understand elasticity, availability zones, and cloud compute scaling patterns.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related PL-300 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free PL-300 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this PL-300 question test?

Model the data — This question tests Model the data — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: CALCULATE(SUM(Sales[Revenue]), DATEDIFF(Sales[OrderDate], Sales[ShipDate], DAY) <= 7) — Option A is correct because it uses CALCULATE to modify the filter context, applying a filter condition that uses DATEDIFF to compute the number of days between OrderDate and ShipDate. The condition `<= 7` correctly identifies orders shipped within 7 days, and SUM aggregates the Revenue column under that filtered context.

What should I do if I get this PL-300 question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 11, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

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.