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

getting max value from a gallery

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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
    37,199 Super User 2026 Season 1 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
    Microsoft Employee 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
    37,199 Super User 2026 Season 1 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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 385

#2
Vish WR Profile Picture

Vish WR 367

#3
timl Profile Picture

timl 340 Super User 2026 Season 1

Last 30 days Overall leaderboard