Preheat the oven to 350 degrees F. Butter the inside of a 9 x 13 or 10 x 15 baking dish.
Heat a large skillet over medium high heat. Add butter and olive oil, then saute fennel and onions until slightly softened, about 5 minutes.
Place a layer of the potatoes on the bottom, overlapping edges slightly. Drizzle cream over the potatoes and then spread some of the onions and fennel over. Sprinkle with thyme, salt, pepper and nutmeg (if using). Repeat layers and then spread gruyere cheese over the top. Press layers down slightly at the end.
Bake at 375° for 60 minutes or until cheese is golden brown and cream has thickened. Remove from oven and let sit for about 15 minutes before cutting to serve.