SPY is up 3% YTD while DXY (which measures the value of a dollar) is down 9% YTD. If you own shares of SPY, then you hold them in dollars, so the real change in value of your stock is [share price] x 1.03 x 0.91, which translates to being down over 6%.
BUT not only is your investment value down, if you live in the US you presumably get paid in dollars as well. Which means you’ve gotten a 9% pay cut since the start of the year.
DXY measures the US dollar against every other currency. So if the US dollar in isolation had a bunch of inflation (e.g. because the US government printed a ton of money), then that would be reflected in DXY.
But if every major currency printed a ton of money at the same time, then DXY would not change because it’s only relative to other currencies.
So it doesn’t calculate inflation directly, but it’s generally correlated with it.