Forum Discussion
LeahGJ
5 years agoFrequent Visitor
Sum only Unique Value for Invoice Number
Hi, I have a dataset, with duplicate data because of multiple lines. I want to sum the value of the invoice amount paid. I used to be able to do same, by using the "line Districtuion Amount" col...
- 5 years ago
LeahGJ ,
you might need something like this:
measure_Item = VAR currentInvNum = MAX ( T[Invoice Number] ) VAR ItemLineType = "ITEM" RETURN CALCULATE ( MAX ( T[Line Distribution Amount] ), FILTER ( ALL ( T ), T[Invoice Number] = currentInvNum && T[Line Type] = ItemLineType ) )If this post helps, then please consider Accept it as the solution ✔️to help the other members find it more quickly.
ERD
Community Champion
5 years agoLeahGJ ,
you might need something like this:
measure_Item =
VAR currentInvNum = MAX ( T[Invoice Number] )
VAR ItemLineType = "ITEM"
RETURN
CALCULATE (
MAX ( T[Line Distribution Amount] ),
FILTER (
ALL ( T ),
T[Invoice Number] = currentInvNum
&& T[Line Type] = ItemLineType
)
)If this post helps, then please consider Accept it as the solution ✔️to help the other members find it more quickly.