# Double numerical integral, in two steps

Let me define the following function:

f[x_] = x


I have to solve the numerical integral:

NIntegrate[NIntegrate[f[x], {x, 0, y}], {y, 0, 1}] (*1*)


and obviously this gives me an error.

I know there is a correct way to do it and the its form is:

NIntegrate[f[x], {y, 0, 1}, {x, 0, y}]


but for several reasons I need to evaluate the integral in the form (1). I cannot use the 'Integrate' built-in function for the symbolic intgeral beacuse the function I have to integrate is very complicated and the time to solve it symbolically is huge.

Is there a way to bypass the error that appears in (1) ?

f[x_] = x;