In Bases, is there a way to count results within a folder?

What I’m trying to do

I have a Base in a folder that has notes further grouped by (sub)folder. This is great and works well! But I would like each grouped heading to show a count of the notes found in its respective folder.

For example, the group headings should look like this: FolderPath (# results).

Things I have tried

file.folder + " " + "(" + file.folder.length + ")"

This is the format I want, but obviously .length does not count results. It only counts the characters in the string that is the folder path. This was the closest I could find to counting from the Bases syntax/formula documentation.

Is it possible to count results how I want to? Thanks in advance!

Caveat: I don’t want to do anything particularly hacky.

One approach I can think of is using the Summarize function in Bases. If you already have a base that lists all notes grouped by folder and subfolder, you could, for example, summarise the file name column by counting filled cells (Filled function should be existing by default.

EDIT: Would be something like this:

That looks promising, but I have no idea what formula you came up with for that, haha. Very little is written about the filled function.

Here you can find the documentation for summaries: Bases syntax - Obsidian Help

If you can not find the Filled formula in your base, here it is: values.filter(!value.isType("null")).length.