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 / Displaying Total count...
Power Apps
Answered

Displaying Total count of collection

(0) ShareShare
ReportReport
Posted on by 174 Moderator

Hi All, I have a collection 

 

 

ClearCollect(colIAM1,Filter( EnvVar_IAM_ITAssetManagement,Index>0 && Index<=2000));
ClearCollect(colIAM2,Filter( EnvVar_IAM_ITAssetManagement,Index>2000 && Index<=4000));
ClearCollect(colIAM3,Filter( EnvVar_IAM_ITAssetManagement,Index>4000 && Index<=6000));
ClearCollect(colIAM4,Filter( EnvVar_IAM_ITAssetManagement,Index>6000 && Index<=8000));
ClearCollect(colIAM5,Filter( EnvVar_IAM_ITAssetManagement,Index>8000 && Index<=10000));
 
ClearCollect(colIAM,colIAM1,colIAM2,colIAM3,colIAM4,colIAM5);

 

 

Now, I need a count of the total number of rows in the collection 

The collection has a variety of assets like desktop, laptop, ipad etc so i need : 

1. total no. of assets

2. distinct assets - with its count 

 

could anybody share the best practice on how i can do this

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

    Hi @Shravyashree_01 ,

     

    1. total no. of assets

    Could you please clarify the meaning of "total number of assets"? Are you trying to calculate how many different types of assets are in colIAM? If so, please try:

    CountRows(Distinct(colIAM,assets))

    2. distinct assets - with its count 

    You could try:

    AddColumns(GroupBy(colIAM,assets,"NewGroup"),"CountRows",CountRows(NewGroup))

    I think this link will help you a lot:

    https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-groupby

     

    Best Regards,

    Bof

  • Shravyashree_01 Profile Picture
    174 Moderator on at

    Hi @v-bofeng-msft  Thank you for the reply.

    "total number of assets" - This is the count of total number of items present in the sharepointList

    ( I think i have to group it and add a column like how u did in [2.] , not sure if its the best practice if possible please help me with this)

     

    For the - 2.  WORKS Perfectly ! 

  • Shravyashree_01 Profile Picture
    174 Moderator on at

    Hi, 

    also wanted to know if countrows works for the data in colIAM exceeding 2000 records (colIAM can have upto 10k records as mentioned in the frst post)

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

    Hi @Shravyashree_01 ,

     

    CountRows will work for colIAM cause it is a collection. Just try:

    CountRows(colIAM)

     

    Best Regards,

    Bof

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
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard