Sum total of selected items

Hi all,

I’m trying to make a very simple POS system.

The just want to be able to tick a few items like Water, Apple and get a sum for the total price for the two.

I have a Stock table with Items as text format and Price as Price format.
I have a sales table with Items as enumlist with validation Stock[Items] and Total as Price format with formula SUM(SELECT(Stock[Price], IN([_THISROW].[Items], Stock[Items])))

i got the above formula from another thread, but it seems to be summing the prices of all the stock and not just the ones i have selected on the form.

Any one know how to fix this?

The problem is the IN() condition. As currently written it returns true if
[_THISROW].[Items] is in Stock[Items] (the list of all items)

Instead what you want is

IN([Items], [_THISROW].[Items]) … i.e. you check if the specific value of [Items] in that row is one of the items selected in the enumlist.

What might be confusing is what [_THISROW] refers to. It refers to the row in the Sales table for which you are computing the Total (and where you are defining this as a Virtual Column, I’m guessing)

1 Like

Worked perfectly, thank you

1 Like

Pardon for reviving old conversations but I have found myself in a similar situation. I would just like to know that are you selecting those items using the bulk select feature?