Hello yet again I need your help. I want to know how can I get the total price based on the items selected and the client name. See example:
Client | items | total price | Client | Item list | Price | |
---|---|---|---|---|---|---|
A | item 1, item 2 | $30 | A | item 1 | $10 | |
A | item 2 | $20 | A | item 2 | $20 | |
A | item 2, item 3 | $50 | A | item 3 | $30 | |
A | item 1 | $10 | B | item 1 | $50 | |
A | item 1, item 3 | $40 | B | item 2 | $60 | |
A | item 1, item 2, item 3 | $60 | B | item 3 | $70 | |
B | item 1, item 2 | $110 | C | item 1 | $100 | |
B | item 2 | $60 | C | item 2 | $200 | |
B | item 2, item 3 | $130 | C | item 3 | $300 | |
B | item 1 | $50 | ||||
C | item 2, item 3 | $500 | ||||
C | item 1 | $100 | ||||
C | item 1, item 3 | $400 | ||||
C | item 1, item 2, item 3 | $600 |
the โitemSโ column is an enumlist that is referenced from a different tab. Also is there a limit on the number of items that can be selected on the enum list?
Solved! Go to Solution.
Oh, I see. Yah, I thought you already had that part figured out since the data was already there. I completely misunderstood from the beginning.
Iโm assuming that [Items] is NOT a Ref type column to the Products table? If so we can pull the appropriate total price with:
SUM( SELECT( Products[Price] , AND( IN( [Product] , [_THISROW].[Items] ) , [Client] = [_THISROW].[Client] ) ) )
And I have the following suggestion for a better way to set this all up, which would make this whole thing work a little bit better:
FILTER( Products , [client] = [_THISROW].[client]
SUM( [Items][Price] )
User | Count |
---|---|
43 | |
29 | |
29 | |
14 | |
14 |