Let $M$ be a positive integer and $qin (1, M+1]$. A $q$-expansion of a real number $x$ is a sequence $(c_i)=c_1c_2cdots$ with $c_iin {0,1,ldots, M}$ such that $x=sum_{i=1}^{infty}c_iq^{-i}$. In this paper we study the set $mathcal{U}_q^j$ consisting of those real numbers having exactly $j$ $q$-expansions. Our main result is that for Lebesgue almost every $qin (q_{KL}, M+1), $ we have $$dim_{H}mathcal{U}_{q}^{j}leq max{0, 2dim_Hmathcal{U}_q-1}text{ for all } jin{2,3,ldots}.$$ Here $q_{KL}$ is the Komornik-Loreti constant. As a corollary of this result, we show that for any $jin{2,3,ldots},$ the function mapping $q$ to $dim_{H}mathcal{U}_{q}^{j}$ is not continuous.