Preheat oven to 400°F (200°C). Lightly grease a 9×13-inch baking dish.
In a skillet over medium heat, melt the butter and olive oil. Add diced onions and cook until soft and translucent.
2 tablespoons unsalted butter, 1 tablespoon olive oil, 1 yellow onion
Stir in flour and cook for 1 minute. Gradually whisk in milk, chicken broth, garlic powder, salt, and pepper. Simmer until thickened, about 3–5 minutes.
3 tablespoons all-purpose flour, 1¼ cups whole milk, ½ cup chicken broth, ½ teaspoon garlic powder, ½ teaspoon salt, ½ teaspoon black pepper
Layer half the potatoes and half the ham in the prepared baking dish. Pour over half of the sauce. Repeat with the remaining potatoes, ham, and sauce.
2 pounds russet potatoes, 2½ cups cooked ham
Cover the dish with foil and bake for 40 minutes. Remove foil, sprinkle shredded cheese on top, and bake uncovered for another 10–15 minutes, or until bubbly and golden.
2 cups shredded cheese
Let rest for 5 minutes before serving. Garnish with chopped parsley.
¼ cup chopped parsley