Forum Discussion
AppleMan
Helper III
2 years agoSumming column once per distinct value in table
I feel this should be easy, but I have not been able to write a measure that accomplishes it how I need it to. To explain, here is an example table of how my data looks: Job Order Date Cre...
- 2 years ago
Try this measure:
Sum Distinct Amount = VAR vTable = SUMMARIZE ( Test, Test[Job], Test[Amount] ) VAR vResult = CALCULATE ( SUMX ( vTable, Test[Amount] ), USERELATIONSHIP ( Test[CreateDate], 'Date Table'[Date] ) ) RETURN vResult
DataInsights
Super User
2 years ago
Try this measure:
Sum Distinct Amount =
VAR vTable =
SUMMARIZE ( Test, Test[Job], Test[Amount] )
VAR vResult =
CALCULATE (
SUMX ( vTable, Test[Amount] ),
USERELATIONSHIP ( Test[CreateDate], 'Date Table'[Date] )
)
RETURN
vResult
AppleMan
Helper III
2 years agoHi thank you, that seems to be working somewhat. I am having an issue where the date slicers (which are hooked up to a different column than the create date) are not properly filtering these values as they should and are filtering them based on the wrong date field. I have used UseRelationship many times so not sure why it is not functioning as intended. But I can see in the table when testing that it is only including one line for the amount per job so I will mark your answer as the solution. I just need to troubleshoot this date issue next.