Hope I understood it correctly. Will this work for you:
Used sample below:
Company Product1 Product2 Product3 Product4 AAA 50 55 0 100 BBB 45 0 70 60 CCC 50 50 50 0 DDD 0 0 40 0
If so, you have to pivot all products and it will give your 2 new fields instead of 15 products. Pivot Name I changed to Products and Pivot Values i changed to Devices. Next is simple formula as above. See for more info attached.
sample-1.twbx 11.8 KB
Did solution above helped you to solve your problem. If so, please mark it as correct answer. If not, please feel free to ask. Thanks