Abstract: Choosing a portfolio of risky assets over time that maximizes the expected return at the same time as it minimizes portfolio risk is a classical problem in Mathematical Finance and is referred to as the dynamic Markowitz problem (when the risk is measured by variance) or more generally, the dynamic mean-risk problem. In most of the literature, the mean-risk problem is scalarized and it is well known that this scalarized problem does not satisfy the (scalar) Bellman's principle. Thus, the classical dynamic programming methods are not applicable. For the purpose of this paper we focus on the discrete time setup, and we will use a time consistent dynamic convex risk measure to evaluate the risk of a portfolio. We will show that when we do not scalarize the problem, but leave it in its original form as a vector optimization problem, the upper images, whose boundary contains the efficient frontier, recurse backwards in time under very mild assumptions. Thus, the dynamic mean-risk problem does satisfy a Bellman's principle, but a more general one, that seems more appropriate for a vector optimization problem: a set-valued Bellman's principle. We will present conditions under which this recursion can be exploited directly to compute a solution in the spirit of dynamic programming. Numerical examples illustrate the proposed method. The obtained results open the door for a new branch in mathematics: dynamic multivariate programming.