Bird
Raised Fist0
Power BIbi_tool~5 mins

SUMX and iterators in Power BI - Cheat Sheet & Quick Revision

Choose your learning style10 modes available
Recall & Review
beginner

What does the SUMX function do in Power BI?

SUMX goes row by row over a table, calculates an expression for each row, then adds all those results together.

Click to reveal answer
beginner

Why do we call SUMX an iterator function?

Because it looks at each row one by one and performs a calculation before summing up the results.

Click to reveal answer
beginner

Write a simple example of SUMX to calculate total sales where each row has Quantity and Price.

Total Sales = SUMX(Sales, Sales[Quantity] * Sales[Price])

Click to reveal answer
intermediate

What is the difference between SUM and SUMX?

SUM adds values in one column directly. SUMX calculates an expression for each row first, then adds those results.

Click to reveal answer
intermediate

Can SUMX be used with any table or only with the original data table?

SUMX can be used with any table or table expression, including filtered or calculated tables.

Click to reveal answer

What does SUMX do?

ACalculates an expression for each row and sums the results
BFilters rows based on a condition
CAdds all values in a single column directly
DCreates a new table from existing data

Which of these is a correct use of SUMX?

ASUMX(Sales, Sales[Quantity])
BSUMX(Sales, Sales[Price] + 10)
CSUMX(Sales[Quantity])
DSUMX(Sales, Sales[Quantity] * Sales[Price])

What type of function is SUMX?

AIterator function
BAggregation function
CFilter function
DLogical function

Which is true about SUMX compared to SUM?

ASUMX is faster than SUM
BSUMX can calculate expressions per row, SUM cannot
CSUMX only works on numeric columns
DSUMX does not support filters

Can SUMX be used on a filtered table?

AOnly if the table has less than 1000 rows
BNo, only on full tables
CYes, it works on any table or table expression
DOnly if the table has numeric columns

Explain in your own words how SUMX works and why it is called an iterator.

Think about how you would add up prices times quantities for each item in a shopping list.
You got /4 concepts.

    Describe a real-life example where using SUMX is better than using SUM.

    Imagine you want total money made from selling different products with different prices and quantities.
    You got /4 concepts.

      Practice

      (1/5)
      1. What does the SUMX function do in Power BI?
      easy
      A. It sums values after calculating an expression for each row in a table.
      B. It counts the number of rows in a table.
      C. It filters rows based on a condition.
      D. It returns the maximum value from a column.

      Solution

      1. Step 1: Understand the purpose of SUMX

        SUMX iterates over each row of a table and evaluates an expression for that row.
      2. Step 2: Summation after calculation

        It then sums all the results of these row-wise calculations to produce a total.
      3. Final Answer:

        It sums values after calculating an expression for each row in a table. -> Option A
      4. Quick Check:

        SUMX = sum after row calculation [OK]
      Hint: Remember: SUMX sums after row-by-row math [OK]
      Common Mistakes:
      • Confusing SUMX with SUM which sums directly
      • Thinking SUMX counts rows
      • Assuming SUMX filters data
      2. Which of the following is the correct syntax for using SUMX in DAX?
      easy
      A. SUMX(Table, Expression)
      B. SUMX(Expression, Table)
      C. SUMX(Table)
      D. SUMX(Expression)

      Solution

      1. Step 1: Identify SUMX parameters

        SUMX requires two parameters: a table to iterate over and an expression to evaluate per row.
      2. Step 2: Confirm correct order

        The correct order is SUMX(Table, Expression), where Table is first, then Expression.
      3. Final Answer:

        SUMX(Table, Expression) -> Option A
      4. Quick Check:

        SUMX syntax = SUMX(Table, Expression) [OK]
      Hint: Table first, expression second in SUMX [OK]
      Common Mistakes:
      • Swapping the order of parameters
      • Providing only one argument
      • Using incorrect parameter types
      3. Given the table Sales with columns Quantity and Price, what is the result of this measure?
      SUMX(Sales, Sales[Quantity] * Sales[Price])
      medium
      A. The maximum Quantity sold in any transaction
      B. The total number of sales transactions
      C. The average price of all sales
      D. The sum of Quantity multiplied by Price for each row

      Solution

      1. Step 1: Understand the expression inside SUMX

        For each row, it multiplies Quantity by Price, calculating the sales amount per transaction.
      2. Step 2: SUMX sums all these calculated amounts

        It adds all these row-wise sales amounts to get the total sales value.
      3. Final Answer:

        The sum of Quantity multiplied by Price for each row -> Option D
      4. Quick Check:

        SUMX = sum of (Quantity * Price) [OK]
      Hint: SUMX sums after multiplying per row [OK]
      Common Mistakes:
      • Thinking it counts rows instead of summing
      • Confusing sum with average or max
      • Ignoring the multiplication inside SUMX
      4. Identify the error in this DAX formula:
      SUMX(Sales, Sales[Quantity] + )
      medium
      A. Table name is incorrect
      B. Missing expression after the plus sign
      C. SUMX cannot use addition inside expression
      D. Quantity column does not exist

      Solution

      1. Step 1: Check the expression inside SUMX

        The expression ends with a plus sign but has no value after it, making it incomplete.
      2. Step 2: Understand syntax requirements

        Every operator must have operands on both sides; missing operand causes syntax error.
      3. Final Answer:

        Missing expression after the plus sign -> Option B
      4. Quick Check:

        Incomplete expression causes syntax error [OK]
      Hint: Check for incomplete expressions after operators [OK]
      Common Mistakes:
      • Ignoring incomplete expressions
      • Assuming SUMX disallows addition
      • Mistaking table or column names
      5. You want to calculate total profit where profit per sale is (Price - Cost) * Quantity. Which DAX formula using SUMX correctly calculates this?
      hard
      A. SUMX(Sales, Sales[Price] - Sales[Cost] * Sales[Quantity])
      B. SUMX(Sales, Sales[Price] - (Sales[Cost] * Sales[Quantity]))
      C. SUMX(Sales, (Sales[Price] - Sales[Cost]) * Sales[Quantity])
      D. SUMX(Sales, Sales[Price] * Sales[Cost] * Sales[Quantity])

      Solution

      1. Step 1: Understand the profit formula per row

        Profit per sale is (Price - Cost) multiplied by Quantity, so parentheses are needed to subtract before multiplying.
      2. Step 2: Check each option's expression

        SUMX(Sales, (Sales[Price] - Sales[Cost]) * Sales[Quantity]) correctly uses parentheses to subtract Price and Cost first, then multiplies by Quantity.
      3. Final Answer:

        SUMX(Sales, (Sales[Price] - Sales[Cost]) * Sales[Quantity]) -> Option C
      4. Quick Check:

        Correct order of operations with parentheses [OK]
      Hint: Use parentheses to ensure correct math order [OK]
      Common Mistakes:
      • Missing parentheses causing wrong calculation
      • Multiplying Cost by Quantity before subtracting
      • Using addition instead of subtraction
      Recommended

      Ready to prove it?

      Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

      10 questions~5 mineasy hard