Forum Discussion
cosmicyes
Helper II
4 years agoSum column distinct per another particular column
I am building a report about costumer complaints. Now I am trying to get the right sum for "Reklamationskosten" (cost). The correct answer is: 113 EUR. The formula should do (in words)...
- 4 years ago
a very nice guy on Stackoverflow gave me the solution:
Reklamationskosten Measure (Agg) = SUMX ( SUMMARIZE ( 'Table', 'Table'[Rekl. ID], 'Table'[Reklamationskosten Art], "Reklamationskosten", MAX ( 'Table'[Reklamationskosten] ) ), [Reklamationskosten] )
amitchandak
Super User
4 years agoTry a measure like , if Reklamationskosten is a column
Sumx(Values(Table[Rekl. ID]), calculate(Sum(Table[Reklamationskosten] )))
if Reklamationskosten is measure , a new measure to be used
Sumx(Values(Table[Rekl. ID]), [Reklamationskosten] )
refer if needed
- cosmicyes4 years ago
Helper II
amitchandak ,
Thank you for your quick reply.
I should have noted that Reklamationskosten is a column, thank you.
So I tried as you suggested
Sumx(Values(Table[Rekl. ID]), calculate(Sum(Table[Reklamationskosten] )))But the result then is 226 EUR.
It counts every row but should only count once per distinct 'Reklamationskosten Art' --> the result should be 113.