Asset Allocation Formula

Hi!

I’m confused about the correct formula for asset allocation. I have seen both answers

(Wi - Wbi) ((Rpi-RB)
Rbi
(Wi-Wbi)

How I know which formula use?

Thanks!

This has been asked a bazillion times; you can search it here.