Hi @wiggin,
There are a few things going on here, but I think I can get you up and running with this feature.
In addition to adding your tag column P to the SELECT part of your QUERY, you also need to add P to the GROUP BY part.
.... GROUP BY " &I1& ",P ORDER BY ...
Since you are selecting now by the Category and the Tag, both need to be in the GROUP BY.
This might work for you by itself. But if you are still having problems, read on.
I also noticed your cell references in the formula are different than the original formula. I believe this is because you added a row or column somewhere. This is the original formula:
=iferror(QUERY(Transactions!A:AE,"SELECT " &I1& " , SUM(" &I3 & ") WHERE " &I4& " >= DATE """ & text(E4, "yyyy-mm-dd") & """ AND " &I4& " <= DATE """ & text(E5, "yyyy-mm-dd") & """ AND " &I2& " = '" & E3 & "' GROUP BY " &I1& " ORDER BY " &I1& " ASC LABEL SUM(" &I3 & ") '', " &I1& " ''", -1),"")
I was able to show Categories and Tags using this adjusted formula:
=iferror(QUERY(Transactions!A:AE,"SELECT " &I1& " , SUM(" &I3 & "),P WHERE " &I4& " >= DATE """ & text(E4, "yyyy-mm-dd") & """ AND " &I4& " <= DATE """ & text(E5, "yyyy-mm-dd") & """ AND " &I2& " = '" & E3 & "' GROUP BY " &I1& ",P ORDER BY " &I1& " ASC LABEL SUM(" &I3 & ") '', " &I1& " ''", -1),"")
You might need to revert back to this formula or modify the formula based on row/column changes you made to the template.
Let us know if that works.
Jon
cc @heather