Persistent Errors - Need Help

I am trying to make an inventory management app with a built-in cart system to check out and/or return multiple items at once. I got the inventory set up, and I got the cart system working. Now all that's left is to connect the quantities of the stock, with the amount being checked out or returned on each order.

I'm working on the math part and I want the app to only target the specific quantity in the order details based off of the two conditions, if the Order ProductID matches the Product ID, and if the OrderDetail ID matches with the Order ID. 

- If I have 30 ribbons in stock, and I add 5 to my cart, I want to subtract those 5 from the stock.
- If I have multiple orders, I do not want all the quantity values of that column to continually affect the stock quantity if a new value is added, hence SUM() wouldn't work

However, I'm stuck with an error.

My expression:

[Quantity] - SELECT(SELECT(Order_Details[OrderDetail_Qty], AND([OrderDetail_ProductID] = [_THISROW].[Key], [OrderLinkText] = Orders[OrderID]) ) )

The Error: 
Cannot compare Text with List in ([OrderLinkText] = Orders[OrderID])
MVJROTC_0-1708409937430.png

I finally figured out how to get OrderDetail_ProductID to match with the Product Key since I had that same issue with it, but I'm getting the issue for OrderLinkText and OrderID

I also run into the issue with previous expressions where my first entry would subtract correctly, but when done again, it would get subtracted by a way larger number. I think that might have been due to me using SUM(Order_Details[OrderDetail_Qty]) or something like that

I'm not sure if I explained it that well, but I hope I can get the help I need.
0 1 28
1 REPLY 1


@MVJROTC wrote:

([OrderLinkText] = Orders[OrderID])


 

instead of this try:

IN([OrderLinkText], Orders[OrderID])

Still no guarantees that this change will give you the expected result simply because I don't know if the filtering will work out to what you think you need. But this will at least remove the error. The reason I am uncertain if your filtering will work out is [OrderLinkText] is named in a way that would suggest it is not a value that is the same as an [OrderID].

 

Top Labels in this Space