I used the online Number Theory Terminal of BoM to understand some more about the digit distribution of numbers. I used dcount == d to display all numbers with d distinct digits from 0 up to 999. I found out following sequence:
dcount == 0 , 0 numbers
dcount == 1 , 28 numbers
dcount == 2 , 324 numbers
dcount == 3 , 648 numbers
dcount >= 4 , 0 numbers
Because of this I was wondering (1) how to explain this sequence (e.g. 648 = 324*2 but how to get from 28 to 324) and (2) if there is a general expression $N(x,d)$ to calculate the amount of numbers $N$ to $x$ that have exacly $d$ distinct digits.

To have dcount=1, you need a single digit number, of which there are $10$, or a two or three digit number where have nine choices for the digit and two choices for the number of digits, for $18$ and a total of $28$. For dcount=3 you have nine choices for the first digit as zero is not allowed, nine choices for the second since it can't match the first, and eight choices for the third since it can't match one of the first two. $9 \cdot 9 \cdot 8=648$. All the rest have dcount=2. I don't think there is any magic in $324 \cdot 2=648$