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 / Create collection from...
Power Apps
Answered

Create collection from another collection with some calculation

(1) ShareShare
ReportReport
Posted on by 118
I have a collection with the name "collForGraphVMS" with the below mentioned columns Title, From, To and Auther. This is regarding users who will visit From date to To date daily.
 
 
I need a new collection with the below output. i.e. Total number of people visiting on a date
 
Date Count
2/23/2025 3
2/24/2025 3
2/25/2025 4
2/26/2025 3
2/27/2025 3
2/28/2025 3
3/1/2025 3
3/2/2025 3
3/3/2025 3
3/4/2025 0
 
Please sugger some ForAll loop or any other way.
I have the same question (0)
  • Suggested answer
    Schjoermann Profile Picture
    18 on at
    Hi Shrikantswnt,
     
    Try the following clearcollect to achieve what you are looking for.
     
    That should give you a result looking like the attached.
     
    If this answers your request, please mark the answer as a verified answer.
     
     
    ClearCollect(
        colCountGroupedData,
        AddColumns(
            GroupBy(
                colForGraphVMS,
                Date,
                Grouped //this is the groupname
            ),
            Count,
            CountRows(Grouped)
        )
    )
  • Verified answer
    shrikantswnt Profile Picture
    118 on at
    @Schjoermann Thanks for the reply. I did some changes and got the result. please check my below code : 
     
    //For Graph
    ClearCollect(collFilterForGraph,Blank());
    ForAll(
        Sequence(DateDiff(DateAdd(Today(),-1), DateAdd(Today(),29), TimeUnit.Days)),        
        Collect(collFilterForGraph,
        {
            date : Text(DateValue(DateAdd(Today(),Value)),"dd-mmm"),
            UserCount: CountRows(Filter(collVMS,
                (DateValue(DateAdd(Today(),Value)) >= DateValue(ThisRecord.ExpDateTime)) && (DateValue(DateAdd(Today(),Value)) <= DateValue(ThisRecord.To))
            )
            )
        }
        )
    );

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 839

#2
Valantis Profile Picture

Valantis 533

#3
Haque Profile Picture

Haque 412

Last 30 days Overall leaderboard