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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
bml123
Post Patron
Post Patron

Sum of distinct values for each customer id

I have data like this and I and I want the output as in Total column where it should sum only the distinct values from amount for each id.  How do I achieve this?

 

IdAmountTotal
11030
11030
12030
11030
22050
22050
23050
22050
22050
23050
1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, @bml123 

Please check the below picture and the formula for creating a new column.

 

Picture3.png

 

Total CC =
VAR currentid = 'Table'[Id]
VAR distinctamount =
FILTER (
SUMMARIZE ( 'Table', 'Table'[Id], 'Table'[Amount] ),
'Table'[Id] = currentid
)
RETURN
SUMX ( distinctamount, 'Table'[Amount] )
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

4 REPLIES 4
Jihwan_Kim
Super User
Super User

Hi, @bml123 

Please check the below picture and the formula for creating a new column.

 

Picture3.png

 

Total CC =
VAR currentid = 'Table'[Id]
VAR distinctamount =
FILTER (
SUMMARIZE ( 'Table', 'Table'[Id], 'Table'[Amount] ),
'Table'[Id] = currentid
)
RETURN
SUMX ( distinctamount, 'Table'[Amount] )
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
amitchandak
Super User
Super User

@bml123 , Try a new measure like

 

sumx(summarize(Table, Table[ID], Table[Amount]),[Amount])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak, I have tried your solution but it is not working.

@bml123 , if need a column, That was measure

Column = sumx(DISTINCT(SELECTCOLUMNS(filter('Table',[Id] =EARLIER('Table'[Id])),"Amt",[Amount])),[Amt])
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Solution Authors