web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Counting Comma Separat...
Power Apps
Answered

Counting Comma Separated Values in Sharepoint List

(0) ShareShare
ReportReport
Posted on by 6

Hi everyone...need some expert advice here 🙂

 

I have a scenario, where my SharePoint list has multi-select column.

I want to count all multi-selected values in that list including single selections against a specific item.

 

below example can explain it,

 

TypeValues
Item 1Sub 1, Sub 2
Item 2Sub 1
Item 1Sub 3
Item 2Sub 2

 

What I want is:

Item 1: Sub Items count: 3

Item 2: Sub Items count: 2

 

any help would be appreciated.

 

Thanks

Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @nomanahmed ,

     

    I assume there is a collection:

    ClearCollect(
     CollectionA,
     {Type:"Item1",Values:"Sub 1,Sub 2"},
     {Type:"Item2",Values:"Sub 1"},
     {Type:"Item1",Values:"Sub 3"},
     {Type:"Item2",Values:"Sub 2"}
    );

    You could try this formula:

    AddColumns(
     GroupBy(Ungroup(AddColumns(CollectionA,"SplitValue",Split(Values,",")),"SplitValue"),"Type","ValueGroup"),
     "Sub Items Count",
     CountRows(ValueGroup)
    )

    vbofengmsft_0-1675394850921.png

     

    Best Regards,

    Bof

     

  • nomanahmed Profile Picture
    6 on at

    Thanks for the reply @v-bofeng-msft & the solution,

     

    while I am still in learning phase, additional help needed 🙂

     

    I am trying to figure out how to perform this... actually, I have a gallery showing the items and i need to show the count in a label under each of the gallery items. source of my gallery is the collection. how & where to add this code

     

    both of the columns (Type & Values) are lookup columns.

     

    AddColumns(
     GroupBy(Ungroup(AddColumns(CollectionA,"SplitValue",Split(Values,",")),"SplitValue"),"Type","ValueGroup"),
     "Sub Items Count",
     CountRows(ValueGroup)
    )

     

  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @nomanahmed ,

     

    I've made a test for your reference:
    1\My SP list:

    vbofengmsft_0-1675402119718.png

    2\

    ShowColumns(
    AddColumns(
     GroupBy(
     Ungroup(AddColumns(Bof02033,"TheType",TypeColumn.Value),"Values"),
     "TheType","ValueGroup"),
     "Sub Items Count", 
     CountRows(ValueGroup)
    ),"TheType","Sub Items Count")

     

    Best Regards,
    Bof

  • nomanahmed Profile Picture
    6 on at

    Thank you @v-bofeng-msft. :).

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 345 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 177

Last 30 days Overall leaderboard