Hello!
Please, check filtering tutorial, especially taxonomy based part of it, and this post. You can find right commands in the tutorial and examples in the post.
It worked when I only added classified genera. However, I am having problems when I have to add unclassified genera (classified to family or order), such as these:
Option 1. Visualize taxonomy file (as qzv) or export/extract a tsv file stored in taxonomy.qza. Get a list of ASV, assigned to desired taxa and use that list to filter the table.
Option 2. Export taxonomy as a tsv table, add substring to desired taxa, for example, "keep_me" at the end. Import it back as taxa_to_keep.qza. Use added substring and taxa_to_keep.qza to filter the table. In further analysis just use your original taxonomy.qza file.