Hi,
In our system which manages equipment, there is a Dataverse table of equipment called Assets, and each item of equipment is assigned an EquipmentCategory, which is a lookup value from another table called Categories. The Categories table is a simple table which contains the category title and the annual maintenance contract value e.g
Column headings: Title, AnnualCost
record values:
"cat 1", 50
"cat 2", 75
"cat 3", 100
etc.
I would like to be able to iterate through the Categories table, and for each category, determine how many records in Assets there are for each category, resulting in a collection e.g.
"cat 1", 2
"cat 2", 4
However, I see that CountIf can't be used within a ForAll function and so I'm stuck now as to how to achieve this neatly. I don't want to have a line of code for each category, as this means (a) it's inefficient and inelegant and (b) if any categories are added in the future I'll need to change the code.
Any help greatly appreciated!
thanks
Martin