TheBoogeyMan
TheBoogeyMan

Reputation: 1

How can I count items in a gallery using variables? PowerApps

I am working on an application and I need to count all the elements from a SharePoint table.

https://i.sstatic.net/Vfjos.png

I am using a variable that is linked to my SharePoint list. Every time when someone will add a new line, my variable will automatically count it and I don't have to add it manually. The problem is that I have another table and my client wants to count all the processes from Service Lines.

https://i.sstatic.net/ZFu20.png. Here I tried a formula but I am not sure how to filter for all of them as I am using only one button and one gallery for all of them.

I need a formula so I can Filter my Service Lines and my Processes. I have a variable called currentServiceLine that will take my Service Line https://i.sstatic.net/6hdbc.png. And I want to count and display all the items from this list https://i.sstatic.net/EXAyJ.png

Can you please assist me?

Upvotes: 0

Views: 2717

Answers (1)

JBerg
JBerg

Reputation: 446

If your button labels are the same as your column values:

CountIf(Table, columnName = ThisItem.Text)

So in your case it might be like this:

CountIf(Processes, 'Service Line' = ThisItem.'Service Line')

If your button labels are not the same as your column's values you could use a switch statement:

CountIf(Processes, 
 'Service Line' = Switch(ThisItem.'Service Line',
                   "Source To Pay",
                   `whatever you want to filter by here',
                   "Order To Cash",
                   `whatever you want to filter by here for Order to cash',
                   "Record To Report",
                   `whatever you want to filter by here for Record To Report')
)

Upvotes: 0

Related Questions