6.4 L 250 2009 P040D

Hello all you wonderful people you! I have a 2009 6.4l f250 and it's been loosing power at high speeds (65mph) dropping to 45mph and a big drop in the rpm. Sometimes after a while things go back to normal. Other times code p040D appears. I changed out the exhaust temp sensor recommended for code p040D and took the truck out to Moab for the weekend. On the first small climb into Utah the power droped like the usual problem and won't go above 2500rpm.turbo only at 1/4 Then the same code. I am at a loss for what to do next and would appreciate some advice. Thank you

Hello all you wonderful people you! I have a 2009 6.4l f250 and it's been loosing power at high speeds (65mph) dropping to 45mph and a big drop in the rpm. Sometimes after a while things go back to normal. Other times code p040D appears. I changed out the exhaust temp sensor recommended for code p040D and took the truck out to Moab for the weekend. On the first small climb into Utah the power droped like the usual problem and won't go above 2500rpm.turbo only at 1/4 Then the same code. I am at a loss for what to do next and would appreciate some advice. Thank you