Table calculations can use only dimensions that have been selected from the field picker, which may be causing you an issue if you are trying to count the values not selected. Another possibly reason for count_distinct might not be working is due to what version of Looker you may be operating on.
The count_distinct function was added to table calculations in version 4.2.2, here is a full list and description of all the available mathematical operators and functions in table calcs:
But I think the most direct way to get your desired result would be to create a measure with a type: count_distinct. Here is a good resource for creating count_distinct measures:
If you have further questions feel free to reach out on chat or email us via email@example.com