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
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
206 | |
188 | |
80 | |
50 | |
38 |
User | Count |
---|---|
305 | |
252 | |
121 | |
73 | |
55 |