Courseiva
Model the data →hardMultiple Choice

PL-300 Model the data Practice Question

You are modeling a fact table with granularity at the order line level. The table includes columns: OrderID, ProductID, Quantity, UnitPrice, Discount. You need to create a measure for total revenue considering discounts (Quantity * UnitPrice * (1 - Discount)). Some orders have no discount (null). What is the correct DAX for this measure?

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

✓

SUMX('Orders', Orders[Quantity] * Orders[UnitPrice] * (1 - COALESCE(Orders[Discount], 0)))

Option D is correct because it uses SUMX to iterate the order-line rows and computes Quantity * UnitPrice * (1 - Discount) per row, while COALESCE(Orders[Discount], 0) replaces null discounts with 0 so lines without a discount are not excluded or turned into blanks. This matches the required revenue formula and handles the stated null-discount scenario. Option A is wrong because it multiplies column totals rather than row-level values and ignores Discount entirely. Option B is wrong because a null Discount makes the whole row expression blank, dropping those order lines from the total. Option C is wrong because it divides by (1 + Discount) instead of multiplying by (1 - Discount), producing an incorrect revenue calculation.

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('Orders'[Quantity] * 'Orders'[UnitPrice])

    Why it's wrong here

    SUM() in DAX accepts only a physical column reference, not an arithmetic expression, so SUM('Orders'[Quantity] * 'Orders'[UnitPrice]) is syntactically invalid and cannot be evaluated. Even if it were valid, it would ignore any discount, producing overstated revenue for every discounted order. The correct approach is to use an iterator like SUMX that evaluates the row-by-row expression and then sums the results.

  • ✗

    SUMX('Orders', Orders[Quantity] * Orders[UnitPrice] * (1 - Orders[Discount]))

    Why it's wrong here

    SUMX iterates each row correctly, but when Orders[Discount] contains BLANK, the expression (1 - Orders[Discount]) also evaluates to BLANK, and multiplying by BLANK propagates BLANK for that entire row. In DAX, BLANK is contagious in arithmetic operations, so the order's contribution silently disappears rather than being treated as a full-price sale. This understates total revenue whenever discount data is missing or incomplete, making the measure unreliable.

  • ✗

    SUMX('Orders', DIVIDE(Orders[Quantity] * Orders[UnitPrice], 1 + Orders[Discount]))

    Why it's wrong here

    Although DIVIDE safely handles division by zero, this formula applies the wrong arithmetic model. Dividing by (1 + Orders[Discount]) neither applies a standard discount nor a markup; the correct logic is to multiply by (1 - Discount), where the discount is a percentage reduction. As written, a 20% discount would divide by 1.2, reducing the result to about 83.3% of the full price instead of the intended 80%, so the result is substantively incorrect.

  • ✓

    SUMX('Orders', Orders[Quantity] * Orders[UnitPrice] * (1 - COALESCE(Orders[Discount], 0)))

    Why this is correct

    This measure uses SUMX to evaluate the expression row by row, and COALESCE converts any BLANK discount into 0 so that missing values are handled gracefully. By using (1 - COALESCE(Orders[Discount], 0)), rows without a discount contribute their full quantity × unit price, while rows with a discount are reduced exactly as intended. This is the correct and robust way to account for nullable discount columns in a fact table.

About these practice questions

This PL-300 question is part of Courseiva's 524-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.