@Anonymous
What is your data row limit set to? This is located under Settings -> General
The default is 500. The max is 2000. It may have even been changed to 100.

Now let's suppose you even set the max to 2000 records.
Well, if you use CountRows(Gallery1.AllItems) - it doesn't matter!
A Gallery loads items 100 at a time,
so therefore CountRows will likely return, at most 100 items.
While a Gallery's Items property may sometimes be a way to help with issues like this, it does not work too well for CountRows in particular, since Galleries count at most 100 items at a time, even if the data row limit is at the max of 2000!
Note that Collections (e.g. ClearCollect, Collect), variables (UpdateContext, Set), and in general, just any functions at all, that are not specifically delegable themselves, are subject to the data row limit. This is even if there is no yellow triangle warning shown. Note that the CountRows function itself is generally not a delegable function. Therefore, it's subject to the Data row limit, whether or not a yellow triangle warning is even shown.
In your case, you have 909 records. I would recommend you just raise the data row limit to the max of 2000 and just use CountRows(DataSourceName) directly on the data source, and you should get 909 as the count!
In terms of what do you do if you have more than 2000 records and want to count them. There are multiple possible approaches depending on the data source. To keep it simple for now, I won't elaborate on this, and would suggest you the simpler solution above for the moment @Anonymous .