Melt 2 tablespoons butter in a saute pan over medium heat. Add chopped onion, cook onions till they become translucent.
Add leeks, cook for about 5 minutes, stirring occasionally. Add chard leaves, cook until they are slightly wilted. Season with salt and pepper then transfer greens to a bowl and set off to the side.
In small saucepan combine yogurt and garlic, bring to a simmer. Cover and proceed to next step.
In a saute pan heat two tablespoons butter over medium heat. Slowly add flour while whisking. Cook for about one minute whisking the entire time. Slowly whisk in yogurt and garlic. Season with salt and pepper and set aside.
Spread a layer of potatoes along the bottom of the greased dish, overlapping as you go. Sprinkle with salt, pepper, and a quarter of the chives, rosemary and of the cheese. Distribute a quarter of the greens mixture over the cheese, then pour sauce over.
Repeat with each layer and sprinkle with the last 1/4 of cheese on top.
Add water to dish and put into oven. Bake for about 1 hour, until golden and bubbly, and most of the liquid is absorbed. Let stand 10 minutes before serving.