Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Missing data under "Groupedby" function

(1) ShareShare
ReportReport
Posted on by 15
Hello, I have a issue that makes me struggled a lot.
 
I have set the OnVisibel property of one of my screens as follow:
 
ClearCollect(
    GroupedItems,
    AddColumns(
        GroupBy(
            Shifts,               // SharePoint list
            ProdID,             // Column to group by
            GroupedData         // Name for the grouped records
        ),
        'Grouped Items', Concat(GroupedData, Text(ProdID) & ": " & Text(Value('Produced CV')), ", "), // Concatenate items in the group
        'Total CV', Sum(GroupedData, Value('Produced CV')),   // Sum of Produced CV for each ProdID
        'Total Slim', Sum(GroupedData, Value('Produced Slim')), // Sum of Produced Slim for each ProdID
        'Total GPA', Sum(GroupedData, Value('Produced GPA'))  // Sum of Produced GPA for each ProdID
    )
)
 
As you can see, I try to group the data by the column "ProdID" in my SharePoint list, and return the sums of different produced products for each ProdID.
 
In my SharePoint list, there are three items that have the same ProdID "241015": one with 10 produced cv, one with 21 produced cv, last one with 20 produced cv.

However, the system only captured the first two items, the sum that my power app returns is only 31.

I created one label to dispaly: 
'Grouped Items', Concat(GroupedData, Text(ProdID) & ": " & Text(Value('Produced CV')), ", "), // Concatenate items in the group
 
I can only see two of "241015" are captured and grouped. 241015:10; 241015:21. The 241015:20 is missing.

My best guess is:the item "241015:20" is created at 241015, but the produced cv was updated at 241016. There might be some unknown issue for the Power App to group all the items.

Could anyone gives me some suggestion or solution? Thx
  • AZ-16101423-0 Profile Picture
    15 on at
    Missing data under "Groupedby" function
    Hello @WarrenBelz 
     
    Thank you! Yes! you are so right! Now things work perfectly!
     
    I added this part into the codes and it saved everything
    ClearCollect(
        FilteredShifts,
        FirstN(
            Sort(Shifts, Modified, SortOrder.Descending), 200
        )
    );


    Love ya so much! 
  • Verified answer
    WarrenBelz Profile Picture
    146,670 Most Valuable Professional on at
    Missing data under "Groupedby" function
    I think I know the issue, but it may not be the answer you want. Firstly, there is nothing wrong with your code, however you need to be aware that GroupBy is a "local" operation and the number of records it can address is restricted by your Data Row Limit (maximum 2,000), so Shifts record numbers needs to under this limit. Your issue I believe is that you are not retrieving the full list to group.
    You can run a Delegable function inside GroupBy to either filter and restrict the record numbers or (in the example below) get the newest records.
    ClearCollect(
       GroupedItems,
       AddColumns(
          GroupBy(
             Sort(
                Shifts,
                ID,
                SortOrder.Descending
             ),              
             ProdID,             
             GroupedData        
          ),
          'Grouped Items', 
          Concat(
             GroupedData, 
             Text(ProdID) & ": " & Text(Value('Produced CV')), 
             ", "
          ),
          'Total CV', 
          Sum(
             GroupedData, 
             Value('Produced CV')
          ),
          'Total Slim', 
          Sum(
             GroupedData, 
             Value('Produced Slim')
          ), 
          'Total GPA', 
          Sum(
             GroupedData, 
             Value('Produced GPA')
          )
       )
    )
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,670 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard