Forum Discussion
JuanPabloCarr
3 years agoNew Member
distinct add with repeated values
Hi, i got the following problem:
We have purchase orders for materials, these are received little by little by the suppliers, so repeated rows of the same order are created as the materials are received as follows:
|Purchase order| | |product| | |quantity order| | |recibed| | |money| |
1 | wood | 30 | 10 | 100$ |
1 | wood | 30 | 20 | 100$ |
2 | door | 20 | 20 | 50$ |
3 | window | 15 | 10 | 300$ |
3 | window | 15 | 5 | 300$ |
How can I sum the amount of money without repeating the amounts depending on the purchase order?
6 Replies
- FreemanZSuper User
try like:
Measure =VAR _table =ADDCOLUMNS(VALUES(TableName[Purchase order]),"Money",CALCULATE(MAX(TableName[Money])))RETURNSUMX(_table, [Money])- JuanPabloCarrNew Member
it isnt working, the code return the same value as if i sum all the values of the column "Money", counting the repeated ones
- smpa01Community Champion
JuanPabloCarr what is the desired end goal based on the sample data
- JuanPabloCarrNew Member
i need a measure to sum 450 (1wood + 1door + 1windows) and not 850 (2wood + 1door +2windows)
- smpa01Community Champion