Загрузка...

💄 What is SUMX? in Power BI. The DAX Function That Changes Everything.

⚡ SUMX Explained Simply — The DAX Function Every Power BI User Must Know

Do you know why your Power BI totals sometimes look completely wrong? Nine times out of ten, the answer is this — you are using SUM when you should be using SUMX.

In this video, I explain the SUMX function in the simplest way possible. No complicated jargon. No confusing theory. Just a clear, plain English explanation with real examples you can follow along with and use straight away in your own Power BI reports.

By the end of this video you will know exactly what SUMX does, why it is different from SUM, and when to use it in your DAX formulas. Let's get into it.

🔷 WHAT IS SUMX?

SUMX is a DAX function in Power BI. DAX stands for Data Analysis Expressions — it is the formula language used in Power BI to create calculations and measures.

SUMX does one simple thing — it goes through a table row by row, performs a calculation on each row, and then adds all those results together at the end.

Think of it like a calculator that works through every single row of your data one at a time, does a sum on that row, remembers the answer, moves to the next row, and keeps going until it has worked through every row. Then it adds everything up and gives you the final total.

That is SUMX. Row by row. Then sum.

🔷 WHAT IS THE DIFFERENCE BETWEEN SUM AND SUMX?

This is where most beginners get confused. Let me explain it as simply as possible.

SUM just adds up all the values in a single column. That is it. You point it at a column, and it gives you the total of that column.

Example:
SUM(Sales[Revenue]) — this adds up everything in the Revenue column.

SUMX is different. SUMX works row by row. You give it a table and an expression. It calculates the expression for each row, then sums all the row-level results.

Example:
SUMX(Sales, Sales[Quantity] * Sales[Price]) — this multiplies Quantity by Price on every single row first, then adds all those results together.

Why does this matter? If you already have a Revenue column in your table, SUM works fine. But if you need to calculate something on each row first — like multiplying two columns together — then you need SUMX.

SUM cannot do row-level calculations. SUMX can. That is the key difference.

🔷 A REAL WORLD EXAMPLE

Imagine you are a shop owner. You have a sales table with three columns — Product, Quantity Sold, and Unit Price.

You want to know your total revenue. But there is no Revenue column in your table. You need to multiply Quantity by Unit Price for each product, then add all the results.

This is exactly what SUMX was built for.

Your DAX measure would look like this:

Total Revenue = SUMX(Sales, Sales[Quantity] * Sales[UnitPrice])

What Power BI does behind the scenes is this:

Row 1 — Product A — 10 units x £5 = £50
Row 2 — Product B — 3 units x £20 = £60
Row 3 — Product C — 7 units x £8 = £56

Then it adds them all up — £50 + £60 + £56 = £166

Total Revenue = £166

If you had tried to do this with SUM, it simply would not work because SUM cannot multiply two columns together row by row. That is why SUMX exists.

🔷 WHEN SHOULD YOU USE SUMX?

Use SUMX when you need to calculate something on each row before summing the results.

Common situations where SUMX is the right choice:

✅ Multiplying two columns together (like Quantity x Price)
✅ Calculating a value per row based on a condition
✅ Working with related tables where row context matters
✅ Building more advanced DAX measures that need row-level logic

Use SUM when you simply want to add up all values in one column with no row-level calculation needed.

🔷 THE MOST COMMON MISTAKE

The most common mistake beginners make is trying to use SUM for calculations that require row-level logic. The result is either an error or — worse — a completely wrong number in their report that looks right but is not.

If your totals look off, always ask yourself — does this calculation need to happen row by row first? If yes, use SUMX.
🔷 QUICK SUMMARY

➡ SUMX goes row by row through a table
➡ It performs your expression on each row
➡ Then it adds all the row results together
➡ Use it whenever you need row-level calculations before summing
➡ SUM adds a column — SUMX calculates then adds

🔔 If this video helped you, please LIKE, SUBSCRIBE and hit the notification bell. I post Power BI and DAX tips every week to help you build better reports and grow your data skills faster.
🌐 Visit us at MyDataStories.co.uk for Power BI training, templates and consultancy services.
#PowerBI #DAX #SUMX #PowerBITutorial #DataAnalytics #BusinessIntelligence #DAXFormulas #PowerBIBeginners #MicrosoftPowerBI #DataAnalyst #PowerBITraining #LearnDAX #PowerBITips #DataSkills #MyDataStories

Видео 💄 What is SUMX? in Power BI. The DAX Function That Changes Everything. канала MyDataStories TV
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять