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 / Maximum Value for List...
Power Apps
Unanswered

Maximum Value for List by Group

(0) ShareShare
ReportReport
Posted on by 1,265

I have a SP List/Power App for vehicles.  From below, the Vehicle No is the left column (i.e., 2, 9, 14, 21, etc.)

RJF61_1-1695825941873.png

Currently, the "Items" properties is...

 

LookUp(VehInsp,
VehNo.Value = ThisItem.VehNo,
Text(Max(CurrentMileage),"#,#.0"))

 

For the gallery I would like to capture the max mileage value by Vehicle Number.  Currently the Items is collecting the first record by Vehcile No.

Categories:
I have the same question (0)
  • Rajkumar_M Profile Picture
    3,741 Super User 2025 Season 2 on at

    Hi @RJF61 

     

    In item gallery

     

    ForAll(
    Distinct(VehInsp, VehNo),
    {
    VehNo: Result,
    MaxMileage: Max(Filter(VehInsp, VehNo = Result), CurrentMileage)
    }
    )

    Thanks!

     

    If my response has been helpful in resolving your issue, I kindly request that you consider clicking "Accept as solution" and "giving it a thumbs up" as a token of appreciation.

     

     

  • RJF61 Profile Picture
    1,265 on at

    Hello @Rajkumar_404 Thanks for the response.  So to ensure I am clear, the current Items for the gallery is...

     

    Sort(
    Filter(
    VehList,
    (Shop.Value=Dropdown2.Selected.Value ||
    Dropdown2.Selected.Value = Blank()
    ) &&
    (
    VehMfg.Value = Radio1.Selected.Value ||
    Radio1.Selected.Value = Blank()
    )
    ),
    VehNoN,
    SortOrder.Ascending
    )

     

    The Items property I previously provided was specific to the Mileage column/field.

     

    Do I incorporate what you provided into my existing gallery Items properties?...

    ForAll(
    Distinct(VehInsp, VehNo),
    {
    VehNo: Result,
    MaxMileage: Max(Filter(VehInsp, VehNo = Result), CurrentMileage)
    }
    )

     

  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @RJF61,

     

    Do I understand it correctly that you would like to see the Max mileage on each row for the corresponding VehNo? Instead of using a LookUp, which fetches the first record matching the condition, you could try the following in the Text property of that label:

    //Style number accordingly
    Text(
     //Display the highest CurrentMileage
     Max(
     //Fetch records matching this VehNo
     Filter(
     VehInsp,
     VehNo.Value = ThisItem.VehNo
     ),
     CurrentMileage
     ),
     "#,#.0"
    )

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • RJF61 Profile Picture
    1,265 on at

    @LaurensM Thanks for the response.  With the suggested option, I am receiving the following...

     

    Delegation warning.  The highlighted part of this formula might not work correctly on large data sets.  The "Max" operation is not supported by this connector.

     

    Suggestions?

  • LaurensM Profile Picture
    12,516 Moderator on at

    @RJF61

     

    A delegation warning is not an error but rather a notification that it may not work as intended when the list exceeds your Data Row Limit. Max is not a delegable function, causing the warning to be displayed. Since we use a delegable filter as the Max() input, this is nothing to worry about. An exception to this would be when the Filter would find > 2000 records, in other words when more than 2000 rows match the VehNo. (Power Apps can only return up to 2000 records from each query)

     

    Is the function not working correctly in your app?

     

    To hide the delegation warning you could use the With() function, but I would not recommend hiding warnings.

    With(
     {
     wRecords: Filter(
     VehInsp,
     VehNo.Value = ThisItem.VehNo
     )
     },
     Text(
     Max(
     wRecords,
     CurrentMileage
     ),
     "#,#.0"
     )
    )

     
    I hope this helps!

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard