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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Counting the contents ...
Power Apps
Unanswered

Counting the contents of multiple Sharepoint columns

(0) ShareShare
ReportReport
Posted on by 332

I'm using a data table in Power Apps to display the contents of a SharePoint text column so that it counts the numbers of each distinct entry. I create a collection with the following formula:

 

ClearCollect(Collection1,
AddColumns(
GroupBy('DataSource',"Column1","Rows"),
"RowCount",
CountRows(Rows)
)
)

 

Then I use Collection1 for the Items property of my data table. 

 

Is there a similar way to count the contents of multiple SharePoint columns?  I've tried something like GroupBy('DataSource', Sum("Column1"+"Column2"),"Rows") but that doesn't work.

 

Thank you!

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at

    Hi @T_A_M ,

    The issue here is that Column1 has multiple items in "Rows" containing Column2. I cannot test this, but it should work

    ClearCollect(
     Collection1,
     AddColumns(
     GroupBy(
     'DataSource',
     "Column1",
     "Rows"
     ),
     "RowCount",
     CountRows(Rows),
     "MyTotal",
     Column1 + Sum(Rows,Column2)
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • T_A_M Profile Picture
    332 on at

    I gave that a try, but the result is that the column in my data table that is supposed to show the totals only shows zeros.

    The Items property of the data table is Collection1, and the text property of the column that's supposed to show the totals is ThisItem.MyTotal.

  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at

    @T_A_M ,

    Is Column1 numeric and what can you see in Colleciton1

  • T_A_M Profile Picture
    332 on at

    Column1 is a text column. 

     

    In Collection1, I see Column1 with text items in it, a column called RowCount with numbers in it, a column called Rows that contains table icons, a column called Title with nothing it, and a column called MyTotal with all zeros in it.

  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at

    @T_A_M ,

    You cannot Sum Text columns, which is why this does not work.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard