If you can attach a sample data set or .twbx that would be helpful to makes sure I'm answering your question.
But, in general, you can use either the COUNT or COUNTD functions in Tableau, depending on what you want to do or what other dimensions you are using in your viz.
So for example, COUNT[country] would count the number of countries, and COUNTD[country] would provide the number of distinct countries. If you have other dimensions in your viz, you may need to modify these calculations based on the count you want to see.
Please reply with a bit more detail about what you're trying to achieve and I'm happy to take a closer look.
Thanks for your reply. Here is a demo to explain my question.
In the Sheet 1, there is a map. After choosing the date filters, there are 18 states which the sum of records are more than 0.
And I want to get the number, 18. What should I do?