Consider the gravitational law:
$$ F \sim \frac{m_1 m_2}{r^2}$$
$$ \mathrm{Force} \sim \mathrm{mass^2}/\mathrm{length^2}$$
The quantities left and right do
not have the same dimensions!
Links force to masses and distance, but not what the absolute value of the force is.
The missing link is established by the gravitational constant $G$:
$$ F = G\frac{m_1 m_2}{r^2}\quad \mathrm{with} \quad G \approx 6.67 \frac{m^3}{kg\,s^2}$$
The value of $G$ depends on the system of units we use.