How does investment have a negative impact on the current account (trade balance)? NX ≡ (S-I) + (T-G)

  
  Read this as “the trade balance (net exports) is identical to the sum
  of net savings (savings minus investment) and the government’s budget
  surplus or deficit (taxes minus spending).” This is not a theory of
  what causes what; it’s an identity, different ways of expressing the
  same “what”.


I understand how savings, tax revenues and government spending may impact current account, but I don't understand how investment would negatively impact current account, it doesn't seem to be right or even make sense. How does Google investing millions in the local economy contribute to the trade deficit?
Balance of payments is composed of:


the capital account (foreign assets and foreign liabilities)
and current account (includes exports and imports)


One way to define the current account is savings minus domestic investment, $S-I$. When $S&lt;I$, a country's investing has to be financed by capital inflows, or investment from foreign countries. This is a deficit on the current account, making the country a net borrower that must seek matching capital inflows like foreign direct investment, that are a credit on the capital account (capital account surplus). 

Whereas, when $S&gt;I$, the excess savings are used to invest in foreign opportunities abroad, creating a current account surplus that makes the country a net lender, giving a capital account deficit.

In relation to the current account, a trade deficit is not identical but is a component of the current account. When there is a current account deficit, a trade deficit happens (imports exceed exports, where imports are not to be confused with investments $I$) because the country does not produce everything it needs and needs to borrow from overseas in order to pay for imports. From Greg Mankiw:


  when we write Y=C+I+G+NX, what is NX? The answer depends on how we define Y. If Y is Gross Domestic Product, then NX is the trade balance. If Y is Gross National Product, then NX is the current account.


Even though a trade deficit sounds bad, standard of living usually increases from a wider variety of imported goods and services, and prices are pushed downwards curbing inflation, but only for so long.