Question 192 of 966
Model the datamediumMultiple ChoiceObjective-mapped

Quick Answer

The most efficient DAX measure for calculating sales in the last 30 days while filtering to customers with more than 5 orders is: TotalSalesLast30Days = CALCULATE(SUM(Orders[TotalAmount]), KEEPFILTERS(Orders[OrderDate] > TODAY() - 30), KEEPFILTERS(CALCULATE(COUNTROWS(Orders), ALLEXCEPT(Orders, Orders[CustomerID])) > 5)). This works because KEEPFILTERS preserves existing filter contexts while allowing the inner CALCULATE to expand row context via ALLEXCEPT, counting orders per customer without triggering unwanted context transitions—a critical efficiency gain over nested FILTER iterators. On the PL-300 exam, this pattern tests your understanding of filter propagation and context transition, often appearing as a trap where candidates mistakenly use FILTER(ALL(Orders), ...) which forces a full table scan. Remember the key insight: KEEPFILTERS lets you apply a customer-level condition inside a single CALCULATE without breaking the date filter. A useful memory tip is "KEEPFILTERS keeps the date, ALLEXCEPT counts the customer."

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.

You have a Power BI model with a table named 'Orders' that contains columns: OrderID, CustomerID, OrderDate, and TotalAmount. You need to create a measure that calculates the total sales amount for orders placed in the last 30 days, but only for customers who have placed more than 5 orders in total. What is the most efficient DAX measure?

Question 1mediummultiple 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

TotalSalesLast30Days = CALCULATE(SUM(Orders[TotalAmount]), KEEPFILTERS(Orders[OrderDate] > TODAY() - 30), KEEPFILTERS(CALCULATE(COUNTROWS(Orders), ALLEXCEPT(Orders, Orders[CustomerID])) > 5))

Option B is correct because it uses KEEPFILTERS to apply both the date filter and the customer-level condition within a single CALCULATE, ensuring that the row context for the customer filter is properly expanded via ALLEXCEPT without causing context transition issues. This approach is more efficient than using multiple FILTER iterators, as it leverages CALCULATE's filter modification capabilities to apply the conditions at the correct granularity.

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.

  • TotalSalesLast30Days = CALCULATE(SUM(Orders[TotalAmount]), FILTER(Orders, Orders[OrderDate] > TODAY() - 30), FILTER(Orders, CALCULATE(COUNTROWS(Orders), ALLEXCEPT(Orders, Orders[CustomerID])) > 5))

    Why it's wrong here

    The FILTER functions are applied incorrectly; they filter the entire table rather than respecting context.

  • TotalSalesLast30Days = CALCULATE(SUM(Orders[TotalAmount]), KEEPFILTERS(Orders[OrderDate] > TODAY() - 30), KEEPFILTERS(CALCULATE(COUNTROWS(Orders), ALLEXCEPT(Orders, Orders[CustomerID])) > 5))

    Why this is correct

    This efficiently applies both filters using CALCULATE with KEEPFILTERS.

    Related concept

    Read the scenario before looking for a memorised answer.

  • TotalSalesLast30Days = SUMX(FILTER(Orders, Orders[OrderDate] > TODAY() - 30 && CALCULATE(COUNTROWS(Orders), ALLEXCEPT(Orders, Orders[CustomerID])) > 5), Orders[TotalAmount])

    Why it's wrong here

    This is inefficient due to SUMX and complex row context.

  • TotalSalesLast30Days = CALCULATE(SUM(Orders[TotalAmount]), DATESINPERIOD(Orders[OrderDate], TODAY(), -30, DAY))

    Why it's wrong here

    This ignores the customer order count condition.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates often choose Option A or C because they think multiple FILTER functions or SUMX are necessary for row-level conditions, not realizing that CALCULATE with KEEPFILTERS and ALLEXCEPT can apply both filters efficiently without nested iteration.

Detailed technical explanation

How to think about this question

KEEPFILTERS in DAX preserves existing filters on a column while adding new filter conditions, which is crucial when combining a date range filter with a dynamic customer-level condition. The ALLEXCEPT function removes all filters except those on CustomerID, allowing the COUNTROWS to compute the total orders per customer regardless of the date filter; this pattern is often used for 'customer-based' measures that need to evaluate a condition across all rows for that customer. In real-world scenarios, this approach avoids the performance hit of iterating over large tables with FILTER and ensures that the measure respects slicers or other report-level filters on CustomerID.

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

A cloud solutions architect for a retail company is evaluating services for a new workload. The correct answer here reflects best practice for the specific scenario described — not a general cloud recommendation. Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option. Cloud exam questions reward reading the constraint carefully: the same technology can be right or wrong depending on the use case.

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: TotalSalesLast30Days = CALCULATE(SUM(Orders[TotalAmount]), KEEPFILTERS(Orders[OrderDate] > TODAY() - 30), KEEPFILTERS(CALCULATE(COUNTROWS(Orders), ALLEXCEPT(Orders, Orders[CustomerID])) > 5)) — Option B is correct because it uses KEEPFILTERS to apply both the date filter and the customer-level condition within a single CALCULATE, ensuring that the row context for the customer filter is properly expanded via ALLEXCEPT without causing context transition issues. This approach is more efficient than using multiple FILTER iterators, as it leverages CALCULATE's filter modification capabilities to apply the conditions at the correct granularity.

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 24, 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.