• Skip to main content
  • Skip to footer

Curbal

Learn how to grow your business with your data and Power BI

  • Data Stories
    • Power BI Stories
    • 1 dataset, 100 matplotlib visualizations
  • Learning Portal
    • Download Center
    • 25 Days Challenge
    • DAX Glossary
    • Power BI
    • Power BI by Topic
    • Python
    • 1 dataset, 100 matplotlib visualizations
  • Courses
    • Power BI Mini Master Class 1: Using a REST API as a data source
    • Power BI Master Class 1: COVID Tracker
    • Introduction to Power BI – FREE Online course
    • M Language + Power Query Course Bundle
    • Power Query Online Training [updated 2022]
    • M Language Online Course: The unofficial and Practical Reference Guide [updated 2025]
    • My Courses
  • Shop
    • Courses
    • Master Classes
    • Template Apps
    • JSON Themes
  • Cart
  • Register/ Log In
    • Become a Member
    • Log In
    • My account
    • My Courses
  • Search
  • Contact
You are here: Home / CM Tooltip Glossary Pro+ / SUMX

SUMX

posted on August 14, 2017

« Back to Glossary Index

Syntax

SUMX(<table>, <expression>)

Table of contents:

  1. Explain the functions
  2. Calculate the sum of distinct values
  3. Calculate the sum of subcategories (or categories)
  4. Sum child values into the parent

1. Explain the functions

In the video below,  we will go through: how to use SUM() and SUMX(), the difference between them and when should we use one vs the other.

The DAX SUM function calculates the sum of all numbers in a column while the DAX SUMX function returns the sum of an expression for each row in a table.

02:28 Create a measure to calculate the total sales using SUMX function
03:40 Create a calculated column for total sales (row by row)
05:16 Create a measure to calculate the total sales using SUM function
06:00 Difference between SUM and SUMX

DAX Fridays! #3: SUM and SUMX

Remarks

The SUMX function takes as its first argument a table, or an expression that returns a table. The second argument is a column that contains the numbers you want to sum, or an expression that evaluates to a column.

Only the numbers in the column are counted. Blanks, logical values, and text are ignored.

Example 2: Calculate the sum of distinct values in DAX

Have you ever tried to calculate the sum of distinct or unique values in Power BI? Not straight forward right?
A distinct sum is a sum where you specify the values that you want to have included in the totals. W
In this video tutorial we will go through the wrong and the right way(s) to do it.
Keynotes:
03:37 SUMX Calculation
06:00 Distinct sum with MAX as part of the expression
08:00 Distinct sum with MAX as a measure

DAX Fridays #12: SUM of distinct values

Download example file:

To get the files:
1. Go to Curbal Download Center > Dax Fridays
2. Get File #12

Example 3: Calculate the sum of subcategories

Let me show you how to calculate the sum of subcategories.

To get the files:
1. Go to Curbal Download Center > Dax Fridays
2. Get File #57

DAX Fridays! #57: Calculate the sum of subcategories

Example 4: Sum child values into the parent

In today’s video, I will show you how to sum child values into the parent when you are dealing with hierarchies in Power BI.

To get the files:
1. Go to Curbal Download Center > Dax Fridays
2. Get File #91

DAX Fridays! #91: Sum child values into the parent
Was this helpful?
See Also:
  • SUM
« Back to Index

Reader Interactions

Comments

  1. Leandro Oliveira

    December 1, 2017 at 7:56 pm

    Hi. The link for the download file is not working anymore. I would really appreciate if you guys check it out. Thank you.

    Reply
    • Ruth Pozuelo Martinez

      December 8, 2017 at 6:22 pm

      Hi Leandro, thanks!
      I just uploaded a working link: http://gofile.me/2kEOD/k9nLfdLZO
      /Ruth

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Footer CTA

Join our community of +50,000 professionals

Become a Member

Subscribe to YouTube

About me:

Curbal AB
Badhusgatan 7B
722 15 – Västerås
Sweden

OrgNo: 5569680852 | VAT: SE556968085201

 

Location:

© Copyright 2014-2025 · Curbal AB · All Rights Reserved · Privacy Policy · Terms of Service · Refund Policy · Log In