Hi@Jesus_Aguirre,
Based on the issue that you mentioned, do you want to know if the output is less than the inventory based on the ID?
Could you please share a bit more about the scenario?
I think a collection could achieve your needs.
I have two tables just like yours stored in OneDrive.
Add a button and create a collection like this:
Collect(ColSum,AddColumns(AddColumns(AddColumns(Inventory,"quantity",LookUp(Deliveries,ID=Inventory[@ID],Quantity)),"Remaining",Quantity-quantity),"Is output less than inventory?",If(Remaining<0,"Yes","No")))
Add a DataTable and set the Items property as below:
ColSum

Note: The "Is output less than inventory?" column will clearly display if the quantity of output is less than that of the inventory.
If you want to pop out a error message when the quantity of output is less than that of the inventory, I think you should use a form.
Add a Gallery and an Edit Form3.
Set the Items property of Gallery as below:
Deliveries
Add a "+" icon and set OnSelect as below:
NewForm(EditForm3);Navigate(Screen3)
Set the DataSource of the form as below:
Deliveries
Set the Item property of the form as below:
Gallery2.Selected
Set the OnChange property of the TextInput corresponding to the Quantity as below:
If(LookUp(Inventory,ID=ThisItem.ID,Quantity)-DataCardValue25.Text<0,Notify("The quantity of output is less than that of the inventory!",NotificationType.Error))
Note: Once you type in a number that more than it is in the Inventory table, an error message will pop up.
Check the GIF.

Hope it could help.
Regards,
Qi