Proportionality relation in electric power

Power is directly proportional as well as inversely proportional by two formulae.How does one justify?
P=V2/R as well as p=I2 R.