Preheat your oven to 375°F (190°C). Grease a 9x13-inch baking dish with cooking spray or butter.
In a large skillet, heat the olive oil over medium heat. Add the sliced onions and sauté until they are soft and translucent, about 5 minutes.
In a large bowl, combine the heavy cream, milk, garlic powder, salt, black pepper, and dried thyme. Whisk until well combined.
Layer half of the sliced potatoes in the bottom of the prepared baking dish. Top with the sautéed onions, then pour half of the cream mixture over the potatoes.
Add the remaining potato slices on top, then pour the rest of the cream mixture over the potatoes. Gently press down to ensure the potatoes are submerged.
Cover the dish with aluminum foil and bake in the preheated oven for 45 minutes.
While the potatoes are baking, season the fish fillets with salt and pepper. After 45 minutes, remove the foil and place the fish on top of the potatoes. Sprinkle the shredded cheddar cheese over the fish.
Return the dish to the oven and bake uncovered for an additional 20-25 minutes, or until the fish is cooked through and the cheese is bubbly and golden.
Remove from the oven and let it cool for 5 minutes. Garnish with chopped parsley before serving.