Sauce: In saucepan, melt butter over medium heat; cook flour, salt, rosemary and pepper, stirring, for 1 minute. Gradually whisk in milk; cook, whisking constantly, until boiling and thickened, 12 to 15 minutes. Set aside.
Peel and thinly slice Yukon Gold and sweet potatoes. Layer half of the Yukon Gold potatoes in greased 13- x 9-inch (3 L) glass baking dish; spread with half of the onion. Layer with sweet potatoes then remaining onion and Yukon Gold potatoes. Pour sauce over top.
Cover with greased foil; bake in 350°F (180°C) oven for 1 hour. Sprinkle with Parmesan cheese; bake, uncovered, until lightly browned and tender, about 30 minutes. Let stand for 10 minutes before serving.