Now that you've added more details into your problem. I can help you more.
The table that I provided is merely just a sample, think of it as the items in your DataSource. I made this formula inside the formulas property of the app. Just substitute your DataSource name in my ShowCountTableSample.
I created a custom table to replicate your scenario.
I'll match the sample with the one you provided. 11 total pending status, 9 - category 1 and 2 - category 2
ShowCountTableSample = Table(
[
{Status: "Pending", Category: "Category 1"},// 1 - pending category 1
{Status: "Pending", Category: "Category 1"},// 2 - pending category 1
{Status: "Pending", Category: "Category 1"},// 3 - pending category 1
{Status: "Pending", Category: "Category 1"},// 4 - pending category 1
{Status: "Pending", Category: "Category 1"},// 5 - pending category 1
{Status: "Pending", Category: "Category 1"},
{Status: "Pending", Category: "Category 1"},
{Status: "Pending", Category: "Category 1"},
{Status: "Pending", Category: "Category 1"},// 9 - pending category 1
{Status: "Pending", Category: "Category 2"},// 1 - pending category 2
{Status: "Pending", Category: "Category 2"} // 2 - pending category 2
]
);
You need to initalize these variable either in the OnVisible property of your screen or the OnStart property of the app. (take not that this will not take into effect unless you right click the app button and click Run OnStart

So, I imitated your problem in power apps in order for me to solve your problem.

What you have to do is set the Text property of the button or is that a label where it states "11" to
set the OnSelect property of Category 1 to
Set(varButtonID,1);
Set(varPendingCategory, CountIf(ShowCountTableSample, Status = "Pending" && Category = "Category 1"));
UpdateContext({locFilterCategory1:!locFilterCategory1})
set the OnSelect property of Category 2 to
Set(varButtonID,2);
Set(varPendingCategory, CountIf(ShowCountTableSample, Status = "Pending" && Category = "Category 2"));
UpdateContext({locFilterCategory2:!locFilterCategory2})
and in the Clear button set the OnSelect property back to
//Show count of clicked button problem
Set(varPendingCategory, CountIf(ShowCountTableSample, Status = "Pending"));
Results:
Category 1 clicked

Category 2 clicked

Clear clicked
Please let me know if this worked. If it worked please mark this as the answer and don't forget to like the comment too :)