cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Regular Visitor

## how to sum some different values for a particular data in a new column?

Hello everybody,

I would like to get sum of the columnA values in a new column for each criteria which is located in column B. How to do that?

As I show in the table below, in the new column,  for every row, I would like to sum the values of column A based on the value of the column B and retrieve it the new column. For instance, for value (A) I expect to have 3000 (1000+2000)

 ColumnA ColumnB New Column 1000 A 3000 2000 A 3000 1500 B 1500

1 ACCEPTED SOLUTION
Super User

This should work for you:

``New Column = CALCULATE( SUM(Table[ColumnA]) , ALLEXCEPT( Table , Table[ColumnB] ) )``
Did I answer your question? Mark my post as a solution! and hit thumbs up
3 REPLIES 3
Super User

This should work for you:

``New Column = CALCULATE( SUM(Table[ColumnA]) , ALLEXCEPT( Table , Table[ColumnB] ) )``
Did I answer your question? Mark my post as a solution! and hit thumbs up
Helper II

Thank you very much my colleague for using a very power formular to solve this problem. Please can I ask if using the formular below would return the same result? If my result is different, please tell me why:

New Column =

CALCULATE(

SUM (Table[ColumnA]),

Table[ColumnB] = “A”

)

Regular Visitor

Thanks, it works.

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.