The most simple formula for calculating the MW link budget is
Path Loss(PL)=92.4+20log f+20Log d
where PL is in dB
f=frequency in GHz,d=distance in km.
Now the power budget equation is
Rx Sensitivity=Tx Power+Tx Antenna Gain+Rx Antenna Gain-Feeder/connector Losses-Path Loss-Fade Margin.
Fade Margin takes care of rain attenuation or ducting(typically 40dB).
Please note that this is very crude formula and does not take into account earth bulge,atmospheric and seasonal variations, which are very important for long haul links. It is okay for short links within a city.
I would suggest a book named “Telecommunication Transmission Systems by Robert J Winch” McGrawHill Publication. You’ll get very good insight to MW systems.