The Dashboard calculates with all transactions in the system, while the Gains page does not take deposits and withdrawals into consideration.
Deposits and withdrawals should be a closed loop for internal transfers of coins from one of your wallet / exchange to another.
If you have just one (deposit or withdrawal) it superfically changes the (dashboard) balance, but is incorrect due to the missing partner.
You can find those single transactions in the Missing transaction report as white lines. Please check the instructions on that page and in this FAQ article: White entries (no match) in Missing Transactions Report
When you have corrected the Missing Transaktions Report, the dashboard and the gains page will match again.