I am going to answer this from a purely economic point of view. I helped my dad flip houses while growing up, have worked on a team flipping and have redone my entire house.
People have mentioned foundation, plumbing, electrical, roof, whatever. It does not matter. It matters on your area of expertise and who you know. If you know a guy who does great foundation work for you at a huge discount then you have a competitive advantage. If you can do all of your plumbing and electric and the house needs that - that is where you make a lot of money. Most of plumbing and electric cost is labor - if you feel your time is free then this is a huge benefit.
So this is where the buying experience comes in. You inspect a home and find that it has foundation issues. (At least in the US/Canada) a seller must disclose this to every other buyer. Everything that is found during your inspection must be disclosed. So it isn't about what is wrong with the house, it is about getting the appropriate discount for the house based on the issue and it is about you as the buyer having an advantage (time/connections/system/materials) that allows you to fix the issues at a discounted rate.
If you don't have a "foundation guy" then yes the advise on other answers is right. I personally don't touch houses with foundation issues. But I did buy houses with termite damage because I had carpentry skills to fix the issues - and often the termite damage is not as bad as people think. I have got "termite infested" housing before, had it sprayed, replaced maybe 10 boards and everything was back to normal...
The next thing is comps. No use fixing up a house and buying the "fixer-upper" if you paid 90% of the high-end house price. Adding 10K of value to a 200K house is basically worthless when you look at buying and selling fees. Also are the upgrades/fixes done to a house going to provide a good return. You could totally redo the electric in a house (100 hours of work) in a bad neighborhood and have a return of 1K after materials - so $10 an hour... In a good neighborhood, house worth triple, that same 100 hours of work might have a return of 10K. Same with upgrades like granite, recessed lighting, or whatever.
The other things to think about are materials. Lumber, most plumbing supplies, most electrical supplies, paint, and stuff like that are much cheaper than the relative value they bring to the home. However if you spend $2000 on a furnace you will be lucky to get your money back. Granite/hard surfaced countertops are a given at some price ranges and regions and then for other price ranges they will get you a 50% return.
And if you are going to live in the house - make sure you have enough area to live while renovating. If every bedroom is used and all areas are used all the time, renovating will suck. Also if you are living in the house you might as well add on 30-50% to the amount of time to complete a task. You have to clean up all the time. Normally on a job site you can leave a certain amount of dust, clutter, tools, whatever... In your house you will be working 5 hours then cleaning 1-2 hours.
And that brings the last point. If climate allows, outside issues are a favorite. If there are landscaping issues, house needs to be painted caulked, trim needs to be fixed, and so on. Great house for a fixer-up to live in. Much less stressful to do the stuff outside and you don't have to deal with the cleanup. Also if living in a house you can actually keep some of the costs down - example is you don't buy sod, you buy grass seed because you have time to make sure the yard grows in.