Show the number of rows of a panel on a Single Stat or Text

I have a single stat that shows the count of a SQL Select and a table that shows the data. Instead of two sql selects, one to count and another to return the data, can I have only the one to return the data and then use some feature to count the table row and shows this information on the single stat?

Thank you