cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
blopezpr
New Member

New Table sum column based on distinct values in a column

I want to create a new table that brings a Distinct Value from a Column and them sum other columns based on that unci value:

 

Example:

 

Table A in Data Model:

 

IDPaid
AA100
AA200
AA300
BB25
BB100
BB25
CC20
CC25
CC5

 

New Table:

 

IDPaid
AA600
BB150
CC50

 

1 ACCEPTED SOLUTION
ERD
Solution Sage
Solution Sage

Hello @blopezpr ,

Here is one of the ways to achieve this:

 

New table = 
ADDCOLUMNS (
    VALUES ( 'Table'[ID] ),
    "Sum", CALCULATE ( SUM ( 'Table'[Paid] ) )
)

 

Did I answer your question? Mark my post as a solution!

 

View solution in original post

1 REPLY 1
ERD
Solution Sage
Solution Sage

Hello @blopezpr ,

Here is one of the ways to achieve this:

 

New table = 
ADDCOLUMNS (
    VALUES ( 'Table'[ID] ),
    "Sum", CALCULATE ( SUM ( 'Table'[Paid] ) )
)

 

Did I answer your question? Mark my post as a solution!

 

View solution in original post

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

Get Ready for Power BI Dev Camp

Power BI Dev Camp - September 30th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.