Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
nok
Helper I
Helper I

Create column that sums all values ​​with the same ID

Hello!

I have a table that follows this structure:

IDValue
A3
A5
B2
C7
D9
D2
D11
E5


I want to create a new column that will sum the value of the "Value" column for all the same IDs.

The expected result would be something like this:

ID     Value   SUM_ValueById
A38
A58
B22
C77
D922
D222
D1122
E55


How can I do this?

1 ACCEPTED SOLUTION
FarhanJeelani
Super User
Super User

Hi @nok  ,

You can achieve this by creating a calculated column in Power BI using DAX.

DAX Formula:

SUM_ValueById = CALCULATE( SUM('Table'[Value]), FILTER('Table', 'Table'[ID] = EARLIER('Table'[ID])) )


Please mark this as solution if it helps you. Appreciate Kudos.

View solution in original post

2 REPLIES 2
FarhanJeelani
Super User
Super User

Hi @nok  ,

You can achieve this by creating a calculated column in Power BI using DAX.

DAX Formula:

SUM_ValueById = CALCULATE( SUM('Table'[Value]), FILTER('Table', 'Table'[ID] = EARLIER('Table'[ID])) )


Please mark this as solution if it helps you. Appreciate Kudos.
rsbin
Super User
Super User

@nok ,

Your Calculated Column is:

SumID = CALCULATE( SUM([Value]),
           ALLEXCEPT( 'Table', 'Table'[ID] ))
 
Regards,

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.