Pick list of products with different quantities

Hello!
I need help with an app that works with orders for my online book shop.
I have a table “Books” with “BookName”, “Price” for each book.
I also have a table “Sales” where all orders are created. If several books are ordered,
I use an expression that calculates the total for the order:

SUM(SELECT(Books[Price], IN([BookName], [_THISROW].[BookName])))

This works only if each book is ordered once. But I have orders where clients order different amounts of books, for instance, they can order two books of one kind, and just one other book. How would the expression look like in this case? Where do I use “Quantity”?

Thank you!

0 1 672
1 REPLY 1

Hi. Sometimes when you load too many concepts into one table you will run into limitations later on. The model you are describing is a classic “add products to line items which are themselves added to invoices” and so forth…

Although built for an unrelated purpose, this app has a model that may help with your design: https://www.appsheet.com/samples/Sample-App?appGuidString=52a2f38b-8e43-46d1-94e5-f5a62bd9d0e6

Please take a look and hopefully it will get you thinking about different ways to model your book data.

Top Labels in this Space