C
Clarity News Hub

Can we use SUMX in measure?

Author

James Craig

Published Jan 17, 2026

This is because since we have used SUMX to arrive at the new column, it has given us the overall total amount for all the rows. So to arrive each row calculation, we need to apply the Power BI SUMX function in “New Measure” not in “New Column.” Right-click on the table and choose “New Measure.”

What is the use of SUMX?

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.

What does SUMX mean?

SUMX is the sum of an expression, the X at the end of this function is for eXpression. This function gives you the sum of any expression.

Can we use calculated column in measure?

We can create a calculated column to reference a measure value like this: Column1= <measure name>. But you need to note the calculated column values are calculated based on table context so it's fixed. To do further calculation, you can use measure directly without creating additional calculated column.

What is difference between SUMX and sum?

Pro Tip: ONLY use SUMX when there is a need for the row-by-row calculation. You could, in theory, use SUMX for a simple aggregation to get the summation of a column; however, due to the iterative nature of SUMX, it uses more resources than a simple SUM function.

34 related questions found

What is SUMX DAX?

SUMX DAX Function (Aggregation)

Returns the sum of an expression evaluated for each row in a table.

Does Tableau use DAX?

Tableau wins hands down in terms of visualisation capabilties though but thats a different thread. DAX is not just used in PowerBI space, but used (based) in SQL Server Analysis Services (SSAS). DAX allows for CALCULATETABLE etc, to return virtual table, that can be filtered.

What is difference between calculated column and measure?

A measure is evaluated in the context of the cell evaluated in a report or in a DAX query, whereas a calculated column is computed at the row level within the table it belongs to.

Can DAX modify or insert data?

DAX cannot modify or insert data, that means source data is SAFE. We can create calculated column and measures with DAX but we cannot calculate rows using DAX.

Where can a calculated column be used?

Use calculated columns

  • If you want your new data to appear on ROWS, COLUMNS, or in FILTERS in a PivotTable, or on an AXIS, LEGEND, or, TILE BY in a Power View visualization, you must use a calculated column. ...
  • If you want your new data to be a fixed value for the row.

Can I use filter in SUMX?

SUMX calculates a sum over a table. The second part of the formula, FILTER(table, expression),tells SUMX which data to use. SUMX requires a table or an expression that results in a table. Here, instead of using all the data in a table, you use the FILTER function to specify which of the rows from the table are used.

Which language is used in power query?

The M language is the data transformation language of Power Query. Anything that happens in the query is ultimately written in M. If you want to do advanced transformations using the Power Query engine, you can use the Advanced Editor to access the script of the query and modify it as you want.

Does Excel use DAX?

DAX includes some of the functions used in Excel formulas, and additional functions designed to work with relational data and perform dynamic aggregation.

Can a DAX measure return a table?

DAX includes many functions that return a table, rather than a value. The table is not displayed in a reporting client, but is used to provide input to other functions. For example, you can retrieve a table and then count the distinct values in it, or calculate dynamic sums across filtered tables or columns.

Is DAX a code?

DAX is not a programming language. DAX is primarily a formula language and is also a query language. You can use DAX to define custom calculations for Calculated Columns, Measures, Calculated Tables, Calculation Groups, Custom Format Strings, and filter expressions in role-based security in Tabular models.

Are measures faster than calculated columns?

Generally, measures are more useful, but the trade-offs are the performance hit (report runtime vs. pre-processed), storage space, and the type of expressions you can use. For example calculated columns are often used when you want to filter on the result rather than just as a calculated result.

What is a column calculation?

A calculated column is an extension of a table that's evaluated for each row. Calculated columns live in the xVelocity in-memory storage of Power BI, just like all the other data you import from a data source. A calculated column is virtually the same as a non-calculated column, with one exception.

Do I need to learn DAX?

It is worth learning DAX. Learning DAX allows flexible applications of data transformation in Power BI, Analysis Services, and Power Pivot. Learning DAX will also allow advanced functions to run more efficiently. DAX is also a common job requirement in BI positions and will be useful during a job search.

What is DAX and MDX?

Both being expression language, MDX and DAX are designed to query an SSAS Cube. The difference, however, lies in the details. MDX can be used to query against SSAS Multi-dimensional models, while DAX is used for SSAS Tabular models.

Is Tableau a code?

Tableau is not a programming language. Tableau is largely different from programming languages: Tableau is a data visualization software but programming languages provide instructions to a computer for output. However, Tableau does use a language, VizQL (Visual Query Language), to translate SQL code into visuals.

Does Power Pivot use DAX?

DAX is used by Power Pivot for data modeling and it is convenient for you to use for self-service BI. DAX is based on data tables and columns in data tables. Note that it is not based on individual cells in the table as is the case with the formulas and functions in Excel.

How do I create a pivot table in DAX?

PIVOT your table in DAX

  1. UnPivot =
  2. SUMMARIZECOLUMNS (
  3. PIVOT[ID],
  4. "Code", CALCULATE ( MIN ( PIVOT[Value] ), PIVOT[Attribute] = "Code" ),
  5. "Desc", CALCULATE ( MIN ( PIVOT[Value] ), PIVOT[Attribute] = "Desc" ),
  6. "Status", CALCULATE ( MIN ( PIVOT[Value] ), PIVOT[Attribute] = "Status" )
  7. )

How do I use DAX in power query in Excel?

You can create a DAX formula for a calculated column in the Power Pivot window.

  1. Click the tab of the table in which you want to add the calculated column.
  2. Click the Design tab on the Ribbon.
  3. Click Add.
  4. Type the DAX formula for the calculated column in the formula bar.

Is DAX similar to SQL?

Finally, we learned that even though both DAX and SQL languages can achieve the same query results, SQL is a declarative language whilst DAX is a purely functional language. Functional languages essentially chain functions together by nesting one function within another.

Can you use SQL in Power Query?

When you connect to a relational database like SQL Server in Power BI/Power Query/Excel Get & Transform you have two choices about how to get the data you need: You can choose a table from the database and then either use the Query Editor UI or write some M to get the data you need from that table.