With WooCommerce Filter “Show count option” you can display the number of products matching the selected category, tag or attribute. An option is available for displaying in the dropdown and multiple dropdowns, checkbox and colours lists on the frontend.
In order to display count for products, open the filter you customize (Product tags, Product categories, Attributes) and check Show count.
Show parents with children. It counts parent category and the children. Warning! If filtering will slow do uncheck this option.
Further, press the Save button and count option will appear in a filter.