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 / Find the MAX in collec...
Power Apps
Unanswered

Find the MAX in collection, and assign values to another variable

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have an SPO List.

I am grabbing this list and putting it in a variable......var_MaxList

There is column called case load.

I want to find the MAX number there and return the entire line into another variable.

So basically, go through the entire collection, find the engineer with the MOST number of cases, and return that to a variable.

Then with that variable I can pull out the different values from SPO.

The other piece is there is a chance that two or more people will have the same amount, so MAX could return three different lines.

I just want it to return the first one found.

Categories:
I have the same question (0)
  • Verified answer
    BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @lardo5150 ,

     

    By sorting the collection by the amount and then taking the first item, you can get the required result:

     

    Set(
    	gblMax,
    	First(
    		Sort(
    			Collection,
    			AmountColumn,
    			SortOrder.Descending
    		)
    	)
    )
  • lardo5150 Profile Picture
    Microsoft Employee on at

    Seems to be returning something right in the middle, not the max for some reason.

  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @lardo5150 ,

     

    Can you please share the results? Perhaps the column type is a text, not a number?

  • lardo5150 Profile Picture
    Microsoft Employee on at

    It is a calcualted column if that makes a difference.

    It is adding two other columns in SPO.

    It is returning something right in the middle (9), when I have someone with 30.

  • lardo5150 Profile Picture
    Microsoft Employee on at

    I had to use Value(SUMCases) (that is my SPO calculated column) instead of just SUMCases.

    Thanks!

  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @lardo5150 ,

     

    Edit: Good to see you get this sorted 🙂

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard