In general, the things that I've seen on this have been speculative. The person who would know would be Donald Trump, but he is likely to answer politically. I.e. the reason that he would state if asked could be the one that is politically advantageous rather than the one that was most important in his thinking. That said, a quick search doesn't find even a political answer to that question. Perhaps no one has asked him.
There are a couple reasons that I've seen as speculation.
- In 2017, the United States was talking with China. They may have wanted to establish positions before moving on to punishments.
- In 2017, the US wanted China to intervene with North Korea to get North Korea to stop testing missiles. They may have prioritized that over trade issues.
In general, the approach in 2017 was to make nice with China. The 2018 approach came after that failed to produce the desired results.