For investors who make a savvy move and wind up with a sizeable capital gain, there can be few things that are more satisfying. Perhaps the only downside is the tax bill you may face from the gain.

If the capital gain is unusually high, you may find that the costs associated with the gain are higher than you expected. A caller to our radio program recently found himself in that predicament and asked us the following question:

I had a large capital gain last year, but my taxes are higher than what I expected. What other taxes could a large capital gain trigger?

We often refer to these unexpected costs as “ripple effects.” By that, we mean that the primary, expected expense sends ripples throughout your financial plan that can create unintended consequences. We thought we’d cover two of the most common ripples you should be prepared for.

Net Investment Income Tax

One possible tax you may trigger, in addition to the capital gains tax, is the Net Investment Income Tax (NIIT). The NIIT has been in effect since 2013 and is a flat, 3.8% surtax that is assessed if you exceed certain modified adjust gross income (MAGI) thresholds ($200,000 if filing single and $250,000 if filing jointly).

The NIIT isn’t assessed on all of your income. It’s assessed on the lower of either 1) the amount your MAGI exceeds the NIIT threshold or 2) your Net Investment Income for the year. For example, Maggie files single with a MAGI of $250,000, including $30,000 in Net Investment Income. In this instance, the $30,000 of Net Investment Income is less than the $50,000 that exceeded the MAGI threshold ($250,000 in MAGI minus the $200,000 earnings threshold). Maggie would face an additional tax bill of $1,140 from the NIIT on that $30,000.

Net Investment Income includes interest, dividends, capital gains, rental income and non-qualified annuities. Not all income sources are subject to this tax; wages, distributions from qualified plans, self-employment income, Social Security benefits and tax-exempt interest are some common sources of income that the NIIT does not apply to. For a complete list of what is and isn’t considered Net Investment Income, you should contact your tax preparer.

Medicare Premiums

The premiums you pay for Medicare Parts B and D are affected by your MAGI, and a large increase in your MAGI can lead to a large increase in your premiums.

Based on this year’s Medicare premiums, someone filing single and earning $75,000 will pay $135.50 monthly Part B premiums. If that same person has a $50,000 capital gain, giving them a MAGI of $125,000, their Medicare Part B premiums would double to $270.90. Add to that the fact that your Part D monthly premiums would increase by $31.90, and you’re looking at over $2,000 in higher Medicare premiums.

To make matters even more confusing, there’s a two-year lag between when your income is reported and when it’s reflected on your premiums. For example, the income you earn in tax year 2019 will affect your Medicare premiums in 2021. So if you had a large capital gain last year, there may be higher Medicare premiums on the horizon for you next year.

These ripple effects, in many circumstances, translate into unexpected costs, making them an extremely frustrating component of financial planning. That’s why if you’re expecting higher than usual income this year, it may be beneficial for you to consult with your tax advisor first to make sure you’re aware of the potential ripples that may be triggered and begin preparing for them.

This article originally appeared on June 26, 2016 in the Brainerd Dispatch. You may view the article here.