Forum Discussion
DAX Calculation for Unique Sum
Hello, I would like to get some help and support with the following DAX I've created:
| Date | ContactID | ContactGroupID | Time1 | Time2 |
| Oct 5 | 123 | 1122 | 60 | 20 |
| Oct 5 | 112 | 1122 | 60 | 20 |
| Oct 7 | 142 | 2233 | 30 | 30 |
| Oct 7 | 125 | 2233 | 30 | 30 |
| Oct 7 | 456 | 2233 | 30 | 30 |
sjacob Try this:
Measure 3 = SUMX ( SUMMARIZE ( FILTER ( MyTable2, MyTable2[ContactGroupID] <> 0 ), MyTable2[ContactGroupID], MyTable2[Time1], MyTable2[Time2] ), [Time1] + [Time2] )
8 Replies
- sjacobFrequent Visitor
Thank you for your response. I tried this measure, but it still sums all the rows from this table. I want to be able to sum a unique ContactGroupID, so like the first row of each ContactGroupID.
- parry2kSuper User
- sjacobFrequent Visitor
Hi parry2k thank you for the response. I did a matrix visualization and I can actually see it working now thank you. However there's a missing piece I forgot to mention. I would like to only get this calculation for the unique rows with a ContactGroupID that is not 0. Looking forward to your response.
- sjacobFrequent Visitor
Hi parry2k thanks for your response. Sure, for example here is sample table:
Date ContactID ContactGroupID Time1 Time2 Oct 5 123 1122 60 20 Oct 5 112 1122 60 20 Oct 7 142 2233 30 30 Oct 7 125 0 30 30 Oct 7 456 0 30 30 From the DAX calculation, I would only want the sum of the unique rows of ContactGroupID that don't equal 0. So just the first row and third row for example.