Forum Discussion
Anonymous
3 years agoNot applicable
Sum total rows that have the same expression
I have DocumentID, LineNo and Amount as columns. I want to sum all DocumentID's Amount that have a specific expression on LineNo. The result from the picture should be the sum of blue values, ...
- 3 years ago
Aha, then try this:
Measure =VAR IDList =CALCULATETABLE(VALUES(TableName[DocumentID]),TableName[LineNo]="test1")RETURNCALCULATE(SUM(TableName[Amount]),IDList)i tried and it worked like this:I used some simplified data like below:
Anonymous
3 years agoNot applicable
This is just a sample. I have millions of documents and I don't know which one of them has "test1" on LineNo.
FreemanZ
Super User
3 years agoAha, then try this:
Measure =
VAR IDList =
CALCULATETABLE(
VALUES(TableName[DocumentID]),
TableName[LineNo]="test1"
)
RETURN
CALCULATE(
SUM(TableName[Amount]),
IDList
)
i tried and it worked like this:
I used some simplified data like below:
- Anonymous3 years agoNot applicable
It works! Thank you!
- FreemanZ3 years ago
Super User
Only in the last chat, came I to understand your expection. The requirement clarification is soooo important.