You weigh the amount you want to test figure A and then you base it so you get figure B and weigh again. Substract figure B from figure A and you get the loss.
Let's say you have 1g of cocaine powder you want to test.
figure A = 1g
let's say after basification you're left with 0,8g.
figure B = 0,8g
1g - 0,8g = 0,2g
That means your coke had 20% impurities and 80% pure cocaine. You're also left with a smokable rock if you do it like that so win win.
If you want powder again you'll have to re-convert it to a salt, though.
Drug-forum has all the TEKs you'll need and more but I can't link you because that site doesn't work with my browser.