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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
nok
Advocate II
Advocate II

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
Community Champion
Community Champion

@nok ,

Your Calculated Column is:

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.