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 / getting max value from...
Power Apps
Unanswered

getting max value from a gallery

(0) ShareShare
ReportReport
Posted on by

I have a gallery called 

glry_ReworkData

 

I have a label called "lbl_ID"  this has the ID for the datasource descending.

that label references a field called - OLD_RW_ID in the datasource.

What I need:  i need to reference this value

I need the value 95.2 to show in a Label. on my form. 

 

How do i get the Max value from that gallery from 

 

DAVIDPOWELL_0-1687292818505.png

 

Thanks Dave

 

Categories:
I have the same question (0)
  • Verified answer
    timl Profile Picture
    36,383 Super User 2025 Season 2 on at

    Hi @Anonymous 

    This should return the maximum value from your gallery:

     

    Max(glry_ReworkData.AllItems, 
     Value(lbl_ID.Text)
    )
  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @Anonymous,

     

    Try the Max() function. Below you'll find an example using the gallery name and text field or using the data source and column name:

    //Gallery + control (change to correct names)
    Max(Gallery1.AllItems, Value(Subtitle1.Text))
    
    //Data source + column name
    Max(TableName, ColumnName)

     

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

    Thanks!

  • Community Power Platform Member Profile Picture
    on at

    Thank you both very very much !!

     

  • boom_powerapps Profile Picture
    101 on at

    @LaurensM @timl What if you want to return the MAX but also return text associated with the MAX value? For example, if Cars = 50, I see how to return the 50 but how do I return the text Cars for example?

  • timl Profile Picture
    36,383 Super User 2025 Season 2 on at

    Hi @boom_powerapps,

    It might be better for you to raise a new post as you may get a better response.

    The high level approach is to sort the data source or the gallery AllItems by the numeric column in descending order by calling the Sort function. You would then call the First function to retrieve the row and to access the associated text column.    

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