Hi @Ethan_R
In the first screen, I used this below using property Text of a Label. So, I use directly the table name 'Area Inspection Steps' and the count is correct. You can check the image 1.
Text = "galItems.All:"
& CountRows(Filter('Area Inspection Steps',
Inspection.'Area Inspection' = ThisItem.'Area Inspection'))
Screen 1:

In the second screen, I used the gallery using the filter with Outcome and the result is correct for each line.
CountRows(Filter(galInspection_Issues.AllItems,Outcome='Inspection Outcome'.Issue))
Screen 2:

In short, I assume that my issue is related to the context variable colSelectedInspection which one hasn't the same table structure then original dataverse table and that the data seems not be updated. I will try to figure out something else. It's just weird that it's the original sourcecode that I downloaded from MSTeams App section.
Thanks,
Dave
==================================
BTW, I find this on ChatGPT. Maybe that could help. But I think I use the right function as Set and UpdateContext.
==================================
In PowerApps, if you want to store the data from a Dataverse table in a context variable, you can follow these general steps. Keep in mind that the process might vary based on the specifics of your app and the data structure. Here's a basic example:
1. **Create a Context Variable:**
- Start by creating a context variable. You can do this in the OnStart property of the app or in a specific screen. For example, if you want to create a context variable in the OnStart property, go to the App object, and in the "OnStart" property, add the following code:
```PowerApps
Set(varMyData, YourDataverseTableName)
```
Replace `varMyData` with the name you want to give to your context variable, and `YourDataverseTableName` with the actual name of your Dataverse table.
2. **Load Data into the Context Variable:**
- You'll need to load the data from the Dataverse table into the context variable. You can use functions like `ClearCollect` or `Filter` to achieve this.
```PowerApps
ClearCollect(varMyData, YourDataverseTable)
```
Replace `YourDataverseTable` with the actual name of your Dataverse table.
3. **Use the Context Variable:**
- Now that your data is stored in the context variable, you can use it throughout your app. For example, you can set the Items property of a gallery to display the data:
```PowerApps
Gallery1.Items = varMyData
```
4. **Update Context Variable as Needed:**
- If you need to update the data in the context variable (for example, if the Dataverse table is updated), you can use the same approach to refresh or update the context variable.
```PowerApps
ClearCollect(varMyData, YourDataverseTable)
```
This will replace the existing data in the context variable with the updated data from the Dataverse table.
Remember to replace placeholders like `varMyData` and `YourDataverseTable` with your actual variable name and Dataverse table name.
Please note that the specific syntax and steps might vary based on your app's structure and requirements. If you encounter issues or need more specific guidance, feel free to provide more details about your app, and I can offer more tailored assistance.
================================================