Courseiva
Model the datamediumMultiple ChoiceObjective-mapped

PL-300 Model the data Practice Question

You have a Power BI data model with a Sales table and a Product table. You want to create a measure that calculates the percentage of total sales for each product category. Which DAX pattern should you use?

⚠ Common exam trap

Candidates often confuse ALL() with ALLSELECTED() or REMOVEFILTERS(), not realizing that ALLSELECTED() preserves external slicer filters while ALL() removes all filters on the specified column, which is essential for calculating a true percentage of total within the current filter context.

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

DIVIDE(SUM(Sales[Amount]), CALCULATE(SUM(Sales[Amount]), ALL(Product[Category])))

It uses DIVIDE for safe division and CALCULATE with ALL(Product[Category]) to remove the filter context on the Product[Category] column, allowing the measure to compute the percentage of total sales for each product category. This pattern ensures that the denominator represents the total sales across all categories, while the numerator respects the current filter context for the specific category.

Answer analysis

Option-by-option breakdown

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

  • SUM(Sales[Amount]) / CALCULATE(SUM(Sales[Amount]), REMOVEFILTERS(Sales))

    Why it's wrong here

    REMOVEFILTERS(Sales) clears filters that are applied directly to columns in the Sales table, but the category filter from the Product table is not necessarily removed because it propagates through the relationship between Product and Sales. This can leave the denominator still filtered by the selected category, so the ratio is not computing the category's share of the overall total. Additionally, removing all Sales filters may also strip other unrelated filters on Sales columns, yielding a denominator that is inconsistent with the intended 'all categories' baseline.

  • SUM(Sales[Amount]) / SUM(Sales[Amount])

    Why it's wrong here

    This expression reduces algebraically to 1 because both the numerator and denominator are the exact same SUM(Sales[Amount]) with no filter modification. It does not attempt to clear the category filter or any other filter context, so it always returns a constant 100% regardless of whether a product category is selected or not. As a measure of percentage of total, it provides no useful information.

  • DIVIDE(SUM(Sales[Amount]), CALCULATE(SUM(Sales[Amount]), ALLSELECTED()))

    Why it's wrong here

    ALLSELECTED() clears all filters that are applied within the current query, but it deliberately preserves filters that come from external slicers or from the outer filter context of the visual. If a user has a slicer on Product[Category], that slicer filter is respected, so the denominator becomes the sum for only the categories selected in the slicer rather than the grand total across all categories. This means the percentage is calculated against the wrong baseline, and it changes depending on slicer selections, which is not appropriate for a percentage-of-total calculation.

  • DIVIDE(SUM(Sales[Amount]), CALCULATE(SUM(Sales[Amount]), ALL(Product[Category])))

    Why this is correct

    ALL(Product[Category]) inside CALCULATE removes only the active filter on the Product[Category] column, while all other filters in the current context (such as date, region, or store) are preserved. This gives a denominator that represents total sales across all product categories within the same filtering context, which is exactly the correct baseline for computing a category's percentage. DIVIDE also safely handles division by zero by returning BLANK instead of an error, making this the most accurate and robust option.

About these practice questions

One of 217 original PL-300 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 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.