ProdID is the key: it represents the production order
Date represents the date. In this case from 28th to 30 september
Product is the name of the product
Total Qty is the total number of pieces that must be produced in the current production order
Produced Pieces is the quantity produce. It represents to which point we are with the production: it is a value that is increased as pieces are produced
MaxProducedPiecesToday represents the total quantity produced in each date, and it is calculated as the maximum of ProducedPieces for each date, using ALLEXCEPT, as explained in the picture
My purpose is to calculate the number of Pieces Produced Today, given by the maximum of pieces produced today minus the maximum of pieces produced in the previous date, that might not be the day immediately preceding.