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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
cosmicyes
Helper II
Helper II

Sum column distinct per another particular column

I am building a report about costumer complaints.

 

cosmicyes_1-1637048163812.png

 

Now I am trying to get the right sum for "Reklamationskosten" (cost).
The correct answer is: 113 EUR.

The formula should do (in words): 
"Sum the 'Reklamationskosten' for each 'Rekl. ID' but only once for each 'Reklamationskosten Art' "

Sure there is a way to do this in DAX but I cannot find out how. 
Thank you all very much in advance!

1 ACCEPTED SOLUTION
cosmicyes
Helper II
Helper II

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]
)

View solution in original post

4 REPLIES 4
cosmicyes
Helper II
Helper II

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]
)
cosmicyes
Helper II
Helper II

Does nobody have an idea? 😢
Do I need to provide additional info?

amitchandak
Super User
Super User

@cosmicyes ,

Try 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

https://www.youtube.com/watch?v=ufHOOLdi_jk

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 ,
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.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.