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 / Create Table counting ...
Power Apps
Unanswered

Create Table counting rows of each type

(0) ShareShare
ReportReport
Posted on by 36

I have a Sharepoint list of data, and I want to have a table in my canvas app with the number of each type of row. 

 

So my Sharepoint list would be like 

SuitNumberOtherInfo
Hearts3blahblah
Hearts4blahblah
Hearts5blahblah
Spades3blahblah
Spades9blahblah
Diamonds2blahblah

 

And I want my app to show 

SuitCount
Hearts3
Spades2
Diamonds1

 

I have a table with the first column, but I am stuck adding the Count column. 

Distinct(Filter(cardDeckSharepointList,Not(IsBlank('Suit'))),'Suit')

 

I think I should use AddColumns and Countif, but I can't figure out how to work it all together. 

Categories:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @jawalley 

    Please consider changing your Formula to the following:

    AddColumns(
     GroupBy(
     Filter(cardDeckSharepointList,Not(IsBlank(Suit))),
     "Suit",
     "_data"
     ),
     "Count", CountRows(_data)
    )

    This will provide the results you want.

     

    I hope this is helpful for you.

  • jawalley Profile Picture
    36 on at

    This is not working. I am still getting errors. 

    jawalley_0-1638563267078.png

     

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @jawalley 

    You are using a data table in your photo and none of those columns will correspond to anything.

    The formula I provided you gives you the two columns you asked for in your post - Suit and Count.

    I cannot tell from your photo if you are putting the formula I provided you into the Items property of the datatable...but that is where it goes.

    Then click on the Edit Fields link in the properties and get rid of the columns you have shown and use Suit and Count.

     

  • jawalley Profile Picture
    36 on at

    Thank you for your help @RandyHayes . Unfortunately it still is not working. I do have the formula in Items, and have hidden all columns but Suit and Count, using the Edit Fields link. 

    If we can get some version of this to work, is there a less manual way to hide fields? I am using cardDeck as a sample, but the real data table I want this to work with has about fifty fields I would need to hide. 

     

    jawalley_1-1638910317527.png

     

  • jawalley Profile Picture
    36 on at

    I believe the issue had something to do with the "Suit" field being the ID or Title field, I was able to get the desired result with the following after setting a new Suit field. 

     

    AddColumns(
    GroupBy(Filter(cardDeckSharepointList,Not(IsBlank(Suit))),"Suit","_data"),
    "Number of Cards",CountRows(_data)
    )

     

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard