Hi Bri
One way to achieve that is though using a gallery to visualise your results and countrows() to calculate the number of model occurences (keep in mind though that the countrows() function is not delegatable to any data sources, which means that if you have more than 500 models for a specific type of model e.g. 550 ModelA models, then the countrows function will only return 500):
This solution will not load your table into a collection:
1. Create a gallery and set its Items property to tableM datasource
2. Insert a text box into the gallery and set its Text property to tableM.ModelName
3. Insert another text box to calculate the count, set its Text property as
CountRows(Filter(tableT, ModelName = ThisItem.ModelName))
Note that the Model name after tableT in the formula above is the name of the column in tableT that contains the model names, while ThisItem.ModelName gives you the current model name from tableM.
A better way to visualise the count in the second text box above is by show "more or equal to 500" if the countrows equals to 500, you can use an If() statement for that.
If you want to load that as a collection, then one way is to set OnVisible property of the app screen to include the following:
1. AddColumns(ClearCollect(collectionModelName, tableM.ModelName), "Model Count",
CountRows(Filter(tableT, ModelName = ModelName))
Note that the first ModelName in the countrows() function will come from tableT while the second ModelName will come from the collectionModelName collection.
THe result of the above should be a collection called collectionModelName that have two columns, the first called ModelName and second - Model Count.
Ivan