Let's say the Digit $D$ is $a_{1}a_{2}a_{3}a_{4}$ .
It is given , $a_{1} \neq a_{2} \neq a_{3} \neq a_{4}$ which is repetition not allowed . it is also given $D$ is divisible by $3$ . From the divisibiilty rule of $3$ we know that sum of digit is also divisible by $3$ .
Now , Given choice of Digits are {1,3,4,6,7} . Now sum of the digits is $1+3+4+6+7=21$ .
Now we have to $5$ digits in the set from where we have to rejects $1$ digit such that after rejecting that the sum is still divisible by $3$ . Now the question is which digits we should reject ? => The digits which are divisible by $3$ .
So , We have to keep $1$,$4$,$7$ and can choose any of the $3$ or $6$ to make the digit D.
So there are $\binom{2}{1}$ ways to choose between $3$ or $6$ and the $4$ digit can arrange in $4!$ ways .
So total number of ways is : $\binom{2}{1}$ *$4!=48$