Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
SUM totals numbers already stored in one column; SUMX calculates an expression for each row and then adds those results. Use SUM for a ready-made amount such as Sales[SalesAmount]. Use SUMX when the amount must be derived, such as quantity multiplied by unit price, or when each row needs conditional or related-table logic.
The distinction is about both input shape and evaluation context. SUM receives a column reference, while SUMX receives a table (or table expression) plus an expression. As an iterator, SUMX creates a current-row context, while report filters still determine which rows are visible.
As an Amazon Associate I earn from qualifying purchases.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11What is the difference between SUM and SUMX in DAX?
SUM is a direct column aggregator. It reads the numeric values in one existing column and returns their total. SUMX is an iterator: it scans a table, evaluates an expression for the current row, and sums the resulting values. Microsoft documents SUMX as “Returns the sum of an expression evaluated for each row in a table” and explicitly classifies it as an iterator (Microsoft Learn: SUMX).
| Comparison | SUM | SUMX |
|---|---|---|
| Input shape | One column reference | A table or table expression plus an expression |
| Evaluation grain | Aggregates values already stored in the column | Evaluates the expression at row grain, then aggregates the results |
| Context supplied by the function | Uses the surrounding filter context | Supplies row context while the expression is evaluated and also respects surrounding filter context |
| Typical use | Total an existing amount column | Derive an amount per row, apply row-level logic, or retrieve a related value before totaling |
Microsoft’s documented syntax makes the boundary clear: SUM(<column>) versus SUMX(<table>, <expression>) (SUM function; SUMX function). The functions are not interchangeable spellings for the same input.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
How does SUM aggregate an existing column?
Use SUM when the model already contains the exact numeric field you want to add. The measure below totals the stored sales amount column:
Total Sales = SUM ( Sales[SalesAmount] )
There is no per-row formula in this measure. DAX reads Sales[SalesAmount] and aggregates the values that are visible under the current filter context. A report page filtered to a month, product, region, or related dimension therefore produces a corresponding subtotal without changing the measure text.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteThe same pattern applies to any column that already represents the business amount being reported: an invoiced amount, a posted cost, or a stored tax value. If the number is already correct at the row level, SUM communicates the intent directly and avoids introducing an unnecessary expression.
SUM accepts a column reference, not a table-plus-expression pattern. That is why a formula such as SUM ( Sales[Quantity] * Sales[Unit Price] ) does not match SUM’s documented contract. The multiplication must be evaluated for each row first, which is the job of SUMX.
Why does quantity multiplied by price require SUMX?
Quantity and unit price are two separate fields. For each sales row, DAX must read both values, multiply them, and only then add the row totals. SUMX expresses that order explicitly:
Revenue =
SUMX (
Sales,
Sales[Quantity] * Sales[Unit Price]
)
The first argument, Sales, supplies the rows to scan. The second argument is evaluated once for each current row. If the table contains three rows, the expression conceptually produces three extended amounts; SUMX then adds those results. The measure is therefore correct even though no single stored column contains the final revenue for every row.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →This approach also handles row-level logic that cannot be represented by simply summing one field. For example, an expression could apply a condition to a row, combine several columns, or choose between values based on a flag. The important question is not whether the final result is a total; both functions return a total. The question is whether the value being totaled already exists as one column or must be computed at row grain.
Do not rewrite the pattern as a column aggregation and expect the same semantics. SUM is defined for one column. SUMX is defined for a table and an expression, so it is the appropriate function whenever the calculation has to happen before aggregation.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Does SUMX create row context, and how does filter context affect the result?
Yes. An iterator establishes a current-row, or row, context while it evaluates its expression. Microsoft describes row context as “the current row” in its DAX overview (DAX overview). Inside the expression, references such as Sales[Quantity] and Sales[Unit Price] resolve against that current row.
Row context does not replace filter context. Filter context is the set of restrictions supplied by the report, slicers, visual axes, relationships, or a formula. SUMX iterates the rows of its table argument as they are available in that surrounding context. Consequently, the same revenue measure can return a company total in one visual, a product subtotal in another, and a filtered-period result on a report page.
Keeping the contexts separate prevents a common debugging mistake. Row context tells the expression which individual row it is currently calculating. Filter context determines which rows are in scope for the calculation in the first place. A measure can have a row-by-row expression and still change when a user changes a slicer because the slicer changes the visible input set.
When diagnosing a result, identify both pieces:
- Which table or table expression is SUMX scanning?
- What filters from the report, relationships, or the formula restrict that table?
- Which columns does the expression read from the current row?
Those questions usually reveal whether an unexpected total comes from the arithmetic itself or from the rows included in the iterator.
How can SUMX use a value from a related table?
SUMX can combine a fact-table column with a value looked up from a related table. Microsoft documents that RELATED requires row context and can be nested in a table-scanning function such as SUMX (RELATED function). For example, if each sales row has a product relationship, extended cost can be calculated as follows:
Extended Cost =
SUMX (
Sales,
Sales[Quantity] * RELATED ( Products[Unit Cost] )
)
For every row in Sales, SUMX supplies the row context. RELATED ( Products[Unit Cost] ) then retrieves the unit cost associated with that row’s product, and the expression multiplies the cost by the row quantity. SUMX adds the resulting extended costs.
This pattern is different from summing a stored cost column. It depends on the relationship and on a value that is obtained while the current sales row is being evaluated. If the relationship or the related value is not available, the lookup portion—not the SUMX aggregation—becomes the issue to investigate.
When does CALCULATE matter inside an iterator?
CALCULATE matters when an expression that summarizes model data must be evaluated in the current row context. Microsoft describes this as context transition: the current row is converted into filter context so the aggregation can be evaluated for that row (CALCULATE function).
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
A representative pattern is a per-customer aggregation over a related sales table:
Customer Sales =
SUMX (
Customers,
CALCULATE ( SUM ( Sales[SalesAmount] ) )
)
Here, SUMX supplies the current customer row. CALCULATE performs context transition so the inner SUM can summarize sales for that customer, assuming the model relationships support that filter propagation. Without the required transition, an expression that summarizes model data may not be evaluated in the intended row-specific context.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Do not add CALCULATE automatically to every SUMX. The quantity-times-price example does not need it because the expression directly reads columns from the current row. Introduce CALCULATE when the expression contains a model-data aggregation or another calculation that must treat the current row as a filter.
This distinction is one reason a short SUMX measure can be deceptively complex: the iterator controls row context, while CALCULATE can change how that row participates in filter context for a nested calculation.
When should you choose SUM instead of SUMX?
Choose the function from the shape of the value you need to total, not from the fact that the visual displays a total.
- Use SUM for a stored amount. If a column already contains the exact amount at the model’s row grain, write
SUM ( Table[Amount] ). - Use SUMX for a derived amount. If the amount requires arithmetic such as quantity times price, pass the table and the row expression to SUMX.
- Use SUMX for conditional row logic. If each row must be tested or transformed before it contributes to the result, an iterator matches that evaluation order.
- Use SUMX for related-column calculations. If a row needs a value retrieved with
RELATEDbefore it can be totaled, keep the lookup inside the iterator’s expression. - Consider CALCULATE only for context transition. Add it when a nested aggregation must evaluate the current row as filter context; it is not a required wrapper for ordinary row arithmetic.
A practical decision test is: “Can I point to one existing numeric column that already represents the number I want?” If yes, SUM is usually the direct expression. If no, identify the table to scan and write the per-row expression for SUMX.
Recommended Free Tools
What are SUMX’s DirectQuery restrictions?
Microsoft lists SUMX as unsupported in DirectQuery calculated columns and row-level security (RLS) rules (SUMX documentation). That is a deployment limitation for those model objects, not a change to the function’s definition.
Before moving a model to DirectQuery, check where the expression will live. A measure, calculated column, and RLS rule have different support considerations. If a SUMX expression is rejected in a calculated column or RLS rule, redesign that calculation in a supported layer rather than assuming that changing SUMX to SUM will preserve the same row-level arithmetic.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Is SUMX always slower than SUM?
There is no universal SUM-versus-SUMX performance percentage in the cited Microsoft function documentation. The references define semantics and support limits; they do not publish a comparative benchmark that applies to every model.
Performance depends on the table being scanned, the expression, relationships, storage mode, and the filters active at query time. Use SUM when it correctly represents a stored amount because it is the clearest semantic choice. Use SUMX when row-level derivation is required, then evaluate the measure in the actual model and report where it will run instead of relying on a blanket claim that one function is always faster.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Avoid “optimizing” a valid row calculation by replacing SUMX with SUM unless you have changed the data model so that an equivalent stored amount column exists. Otherwise, the rewrite changes the calculation rather than merely improving it.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.What common mistakes produce incorrect totals?
Trying to pass an expression to SUM
SUM ( Sales[Quantity] * Sales[Unit Price] ) does not follow SUM’s one-column syntax. Use SUMX with Sales as the table and the multiplication as the expression.
Summing the wrong stored field
A quantity column and a unit-price column are not an extended revenue column. Adding either one alone answers a different question. Confirm that the column you give SUM already represents the business amount you intend to report.
Forgetting that report filters still apply
An iterator does not automatically mean “all rows in the database.” The table argument is evaluated under the active filter context. Check slicers, visual filters, and relationships when a measure changes between visuals.
Free tools Windows power users keep installed
One-click scans. No signup required.
Adding CALCULATE without a context-transition need
CALCULATE is relevant when a nested summary must use the current row as filter context. It is not required merely because SUMX appears in the measure. Unnecessary wrappers make the intent harder to read and can obscure which part of the formula needs transition.
Ignoring the model’s storage mode
If the expression is destined for a DirectQuery calculated column or RLS rule, consult the documented SUMX support restriction before deployment. A formula that works as a measure may not be supported in those other objects.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
How can you verify a SUMX measure?
Verification should follow the same order as evaluation. First, inspect a few source rows and calculate the expected row amount manually. Next, check that the table argument includes the intended rows under the report’s current filters. Then confirm that every column reference resolves to the current row and that any RELATED lookup follows an existing relationship.
For a measure that contains a nested aggregation, separately ask whether the inner expression needs context transition. If it summarizes model data for each iterator row, test the version with CALCULATE and compare it with the intended per-row result. This isolates row arithmetic, filtering, relationship lookups, and context transition instead of treating the final total as one opaque number.
Document the grain in the measure name or description when the distinction matters. “Total Sales” signals a stored amount aggregation; “Revenue” or “Extended Cost” can indicate that a row expression is being evaluated before summation. Clear naming helps report authors choose the right measure without reopening the formula.
What should you remember about SUM and SUMX?
SUM is the right tool for adding an existing numeric column. SUMX is the right tool when DAX must evaluate an expression for each row before it can produce the total. The iterator creates row context, while filter context from the report and model determines which rows participate. RELATED can supply a related-table value inside that row context, and CALCULATE is reserved for cases where a nested summary needs context transition. Keep the DirectQuery calculated-column and RLS restriction in view, and avoid performance claims that are not supported by a benchmark for your model.
Frequently Asked Questions
Can SUM add values from two columns in one call?
No. SUM takes one column reference. If the desired row value combines two or more columns, calculate that expression with SUMX; if each column represents a separate business total, use separate SUM measures and combine those results explicitly.
Why does the same SUMX measure change when I move it to another visual?
Visual axes, slicers, relationships, and page filters contribute filter context. SUMX evaluates only the rows of its table argument that remain visible in that context, so a grouped visual can show subtotals while a card shows a broader total.
Do I need CALCULATE whenever SUMX appears in a formula?
No. Direct row arithmetic such as quantity times unit price works with SUMX alone. CALCULATE is relevant when the iterator expression contains a model-data aggregation that must treat the current row as filter context.
Does the DirectQuery note prohibit SUMX in every measure?
The Microsoft function reference specifically lists SUMX as unsupported in DirectQuery calculated columns and row-level security rules. That statement does not by itself declare every measure use unsupported; check the requirements of the particular model object and storage mode.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

