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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Wildglen
Regular Visitor

sum columns with same id

Hello,

 

I have the following table:

 

 

Image and video hosting by TinyPic

 

I'm trying to create a custom column which sums Hoeveelheid for items with the same SolutionID. So far I've come up with: 

 

Column = SUMX(FILTER(tbl_SolutionChemicals;tbl_SolutionChemicals[SolutionID]=tbl_SolutionChemicals[SolutionID]);tbl_SolutionChemicals[Hoeveelheid])

 

But this returns the sum of all Hoeveelheid rows. Can anyone help me with this?

3 ACCEPTED SOLUTIONS
Wildglen
Regular Visitor

<p>Hello,</p>
<p>&nbsp;</p>
<p>I have the following table:</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="http://nl.tinypic.com?ref=5ukz0l" target="_blank"><img src="http://i67.tinypic.com/5ukz0l.jpg" border="0" alt="Image and video hosting by TinyPic"></a></p>
<p>&nbsp;</p>
<p>I'm trying to create a custom column which sums Hoeveelheid for items with the same SolutionID. So far I've come up with:&nbsp;</p>
<p>&nbsp;</p>
<p>Column = SUMX(FILTER(tbl_SolutionChemicals;tbl_SolutionChemicals[SolutionID]=tbl_SolutionChemicals[SolutionID]);tbl_SolutionChemicals[Hoeveelheid])</p>
<p>&nbsp;</p>
<p>But this returns the sum of all Hoeveelheid rows. Can anyone help me with this?</p>

View solution in original post

Anonymous
Not applicable

Dear @Wildglen

 

Please try this:

 

Column= CALCULATE(SUM(tbl_SolutionChemicals[Hoeveelheid]), ALLEXCEPT(tbl_SolutionChemicals, tbl_SolutionChemicals[SolutionID])  )

 

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

 

i am assuming that you want to create a calculated column formuls in the PowerPivot.  If that be the case, then try this

 

=CALCULATE(SUM(tbl_SolutionChemicals[Hoeveelheid]),FILTER(tbl_SolutionChemicals,tbl_SolutionChemicals[SolutionID]=EARLIER(tbl_SolutionChemicals[SolutionID])))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
Eric_Zhang
Microsoft Employee
Microsoft Employee

@Wildglen

You can try

custom column =
CALCULATE (
    SUM ( tbl_SolutionChemicals[Hoeveelheid] ),
    ALLEXCEPT ( tbl_SolutionChemicals, tbl_SolutionChemicals[solutionid] )
)

However, instead of a calculated column, I'd suggest you create a measure which would have more interaction among visuals.

Ashish_Mathur
Super User
Super User

Hi,

 

i am assuming that you want to create a calculated column formuls in the PowerPivot.  If that be the case, then try this

 

=CALCULATE(SUM(tbl_SolutionChemicals[Hoeveelheid]),FILTER(tbl_SolutionChemicals,tbl_SolutionChemicals[SolutionID]=EARLIER(tbl_SolutionChemicals[SolutionID])))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Dear @Wildglen

 

Please try this:

 

Column= CALCULATE(SUM(tbl_SolutionChemicals[Hoeveelheid]), ALLEXCEPT(tbl_SolutionChemicals, tbl_SolutionChemicals[SolutionID])  )

 

Wildglen
Regular Visitor

<p>Hello,</p>
<p>&nbsp;</p>
<p>I have the following table:</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="http://nl.tinypic.com?ref=5ukz0l" target="_blank"><img src="http://i67.tinypic.com/5ukz0l.jpg" border="0" alt="Image and video hosting by TinyPic"></a></p>
<p>&nbsp;</p>
<p>I'm trying to create a custom column which sums Hoeveelheid for items with the same SolutionID. So far I've come up with:&nbsp;</p>
<p>&nbsp;</p>
<p>Column = SUMX(FILTER(tbl_SolutionChemicals;tbl_SolutionChemicals[SolutionID]=tbl_SolutionChemicals[SolutionID]);tbl_SolutionChemicals[Hoeveelheid])</p>
<p>&nbsp;</p>
<p>But this returns the sum of all Hoeveelheid rows. Can anyone help me with this?</p>

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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