Courseiva

PL-300 Visualize and analyze the data Practice Question

You have a Power BI dataset with a 'Sales' table that includes a 'ProductID' column. You also have a 'Products' table with 'ProductID' and 'Category' columns. You create a relationship between the tables. You want to create a measure that calculates the total sales for products in the 'Electronics' category. Which DAX expression 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

✓

CALCULATE(SUM(Sales[Amount]), Products[Category] = "Electronics")

Option D is correct because CALCULATE modifies the filter context of SUM(Sales[Amount]) by applying a filter on the related Products table's Category column, and since a relationship exists between Sales and Products, the filter propagates to the Sales table to return only Electronics sales. Option A is invalid syntax: SUMX requires a table as its first argument and an expression as its second, not a boolean condition and a column. Option B is wrong because RELATED is a column-reference function that requires row context and cannot be used directly inside a CALCULATE filter argument like that. Option C returns total sales for all categories with no Electronics filter applied.

Answer analysis

Option-by-option breakdown

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

  • ✗

    SUMX(Products, Products[Category] = "Electronics", Sales[Amount])

    Why it's wrong here

    This expression is syntactically invalid because SUMX requires exactly two arguments: a table to iterate and a scalar expression to evaluate for each row. Passing a boolean condition as a second argument and Sales[Amount] as a third violates the function signature, so the measure would not compile. To filter within an iterator, you must nest FILTER inside SUMX (e.g., SUMX(FILTER(...), ...)), not pass a predicate directly as a separate argument.

  • ✗

    CALCULATE(SUM(Sales[Amount]), RELATED(Products[Category]) = "Electronics")

    Why it's wrong here

    RELATED is a row-context function that can only be called when a row context exists, such as inside a calculated column or an iterator like ADDCOLUMNS. In a measure, CALCULATE's filter arguments are evaluated in the existing filter context, not a row context, so RELATED has no row to navigate across the relationship and the expression raises an error. The correct filter predicate should directly reference the column 'Products[Category] = "Electronics"', letting CALCULATE use the relationship automatically.

  • ✗

    SUM(Sales[Amount])

    Why it's wrong here

    This scalar aggregation simply adds up every value in Sales[Amount] that survives the current filter context, with no constraint on product category. Because the Products table is not filtered or referenced, the result includes sales from all categories, not just Electronics. It ignores the many-to-one relationship between Sales and Products entirely, yielding a broader total than requested.

  • ✓

    CALCULATE(SUM(Sales[Amount]), Products[Category] = "Electronics")

    Why this is correct

    CALCULATE is the correct DAX function for modifying filter context. Here it evaluates the sum of Sales[Amount] within a filter context where Products[Category] is restricted to "Electronics". The predicate references a column on the related Products table, and CALCULATE automatically propagates that filter across the existing relationship between Sales and Products, so only matching sales rows are aggregated.

About these practice questions

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