sum select from 2 table with same non key Item ID

Hi everyone, 

i have a virtual column that show the quantity of a product available. 

below is the formula 
SUM(SELECT(Inventory[Amount],([Item ID] = [_THISROW].[Item ID])))

is it possible to add another column from a different table

SUM(SELECT(Inventory[Amount],([Item ID] = [_THISROW].[Item ID]))+(AddStock[Amount],([Item ID] = [_THISROW].[Item ID])))
i tried the above formula but the amount added in AddStock will affect all other Item ID and not the specific Item ID that i want.


Solved Solved
0 2 201
1 ACCEPTED SOLUTION

Just a quick check, unless it is a typo your expression seems to be missing a second SELECT.

SUM(
  SELECT(Inventory[Amount], ([Item ID] = [_THISROW].[Item ID]))

  +

  (AddStock[Amount], ([Item ID] = [_THISROW].[Item ID]))
)

 

SUM(
  SELECT(Inventory[Amount], ([Item ID] = [_THISROW].[Item ID]))

  +

  SELECT (AddStock[Amount], ([Item ID] = [_THISROW].[Item ID]))
)

 

Could this be the issue? (but again, I would think your original expression would raise a format error...)

View solution in original post

2 REPLIES 2

Just a quick check, unless it is a typo your expression seems to be missing a second SELECT.

SUM(
  SELECT(Inventory[Amount], ([Item ID] = [_THISROW].[Item ID]))

  +

  (AddStock[Amount], ([Item ID] = [_THISROW].[Item ID]))
)

 

SUM(
  SELECT(Inventory[Amount], ([Item ID] = [_THISROW].[Item ID]))

  +

  SELECT (AddStock[Amount], ([Item ID] = [_THISROW].[Item ID]))
)

 

Could this be the issue? (but again, I would think your original expression would raise a format error...)

thank you very much

Top Labels in this Space