I have a multi lookup field in my sharepoint.
I would like to get the disctinct count of each value used in that field.
For example if I have 2 records:
1. Janet, Steve, Corey
2. Janet, Mike, Corey
I need a collection with these values:
Name, Count
Janet, 2
Steve, 1
Corey, 2
Mike, 1
Is it possible for my PowerApp to generate this collection on load?
Solved! Go to Solution.
Hi @simkessy
Clear(CountCollection);ForAll(MultiLookupList,ForAll(Persons,If(!(DisplayName in CountCollection.Name),Collect(CountCollection,{Name: DisplayName,Count:1}),Patch(CountCollection,LookUp(CountCollection,Name = DisplayName),{Count:LookUp(CountCollection,Name = DisplayName).Count + 1}))))
Hope this Helps!
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Hi @simkessy
Clear(CountCollection);ForAll(MultiLookupList,ForAll(Persons,If(!(DisplayName in CountCollection.Name),Collect(CountCollection,{Name: DisplayName,Count:1}),Patch(CountCollection,LookUp(CountCollection,Name = DisplayName),{Count:LookUp(CountCollection,Name = DisplayName).Count + 1}))))
Hope this Helps!
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Hi @simkessy
Could you please reference @yashag2255 's suggestion?
If it works fine,please accept it as solution.
Best Regards.
Yumia
User | Count |
---|---|
161 | |
85 | |
71 | |
64 | |
62 |
User | Count |
---|---|
208 | |
147 | |
95 | |
84 | |
67 |