Obsidian Dataview: how to do a count with group by and a total

Like this?

```dataview
TABLE length(rows) AS "file count"
GROUP BY choice(
		endswith(file.name, " PA"), "PA", choice(
			endswith(file.name, " TS"), "TS", choice(
				endswith(file.name, " FB"), "FB", "-"
			)
		)
	) AS suffix
WHERE suffix = "PA" OR suffix = "TS" OR suffix = "FB"
```

And then for the total:

```dataview
LIST without ID "Total " + length(rows)
WHERE endswith(file.name, " PA") OR endswith(file.name, " TS") OR endswith(file.name, " FB")
GROUP BY ""
```

They look like this:

Your WHERE statement was telling Dataview to look at only the PA files; that’s why only those were showing up. This new code includes all three types of files.

And it looks only at the end of the filename (endswith) so that something like “JILL AND PAM.md” won’t accidentally get included.

I did the total count separately because I think you might need dataviewJS to put them in one table, or a br in the TABLE statement. Two queries seemed better than one in this case.

(edit to add screenshot)