• Skip to main content
  • Skip to footer

Curbal

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

  • Resources
    • DAX Glossary
    • Download Center
    • Template Apps
    • Data Stories Gallery
    • Solution Gallery
    • Learning Resources
  • Courses
    • Introduction to Power BI – FREE Online course
    • Power Query Online Training for Power BI
    • M Language Online Course: The unofficial and Practical Reference Guide
  • Blog
  • Shop
    • Courses
    • Swag
    • Template Apps
    • Donations
  • Cart
  • Register/ Log In
    • Become a Member
    • Log In
    • My account
    • My Courses
  • Contact
You are here: Home / CM Tooltip Glossary Pro+ / SUMX

SUMX

posted on August 14, 2017

« Back to Glossary Index

Syntax

SUMX(<table>, <expression>)

Tutorial with example

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

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

Download example file:

Link to sample pbix here

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.

Was this helpful?
[Total: 3   Average: 5/5]
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

Let us know your thoughts... Cancel reply

Footer CTA

Join our community of +20,000 professionals

Become a Member

Subscribe to YouTube

About us

Curbal AB
Kopparbergsvägen, 10
722 13 – Västerås
Sweden

OrgNo: 5569680852 | VAT: SE556968085201

 

Location:

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