Preheat the oven to 350°F (175°C). Generously grease a Bundt pan, making sure to get into all the grooves.
If using whole pistachios, grind them finely in a food processor to make pistachio flour. Zest the lemons and set aside.
In a large bowl, whisk together the pistachio flour, all-purpose flour, baking powder, and salt.
In a separate bowl, beat the butter and sugar until smooth and creamy. Add the eggs one at a time, mixing well after each addition.
Gradually add the milk, mixing until fully incorporated.
Slowly add the flour mixture to the wet ingredients, mixing bit by bit until the batter is smooth.
Fold in the lemon zest and lemon juice.
Pour the batter into the prepared Bundt pan and smooth the top.
Bake for 60–75 minutes, or until a skewer inserted into the center comes out clean.
Let the cake cool in the pan for 10 minutes, then carefully turn out onto a wire rack and cool completely.
To make the frosting, beat the cream cheese until smooth. Add the icing sugar, lemon juice, and vanilla. Gradually add warm water until you reach a pourable but creamy consistency.
Drizzle the frosting over the cooled cake and let it set before slicing.