Preheat your oven to 350°F (175°C). Grease and flour a 9x13-inch baking pan or line it with parchment paper.
In a large bowl, whisk together the flour, baking powder, baking soda, cinnamon, and salt. Set aside.
In another bowl, cream the softened butter and granulated sugar until light and fluffy, about 3-4 minutes.
Add the eggs one at a time, mixing well after each addition. Stir in the vanilla extract.
Gradually add the flour mixture to the butter mixture, alternating with the buttermilk. Start and end with the flour mixture, mixing until just combined.
In a separate bowl, toss the chopped apples with lemon juice and raisins (if using). Gently fold the apples into the batter until evenly distributed.
Pour the batter into the prepared baking pan and spread it evenly. Bake for 45-50 minutes, or until a toothpick inserted in the center comes out clean.
Allow the cake to cool in the pan for 10 minutes before transferring it to a wire rack to cool completely. Dust with powdered sugar before serving if desired.