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 maximum date f...
Power Apps
Answered

Getting maximum date from list of selected items

(0) ShareShare
ReportReport
Posted on by 21

I need to get the maximum date from a list of selected items in a combo box.

 

This:

 

Sort(ComboBox1.SelectedItems.'End Date','End Date',Descending).'End Date'

 

Gives me a one column table of the dates which I can make show up properly in a list box.  When I apply the First function like this:

 

First(Sort(ComboBox1.SelectedItems.'End Date','End Date',Descending).'End Date')

 

I end up with what looks like a date serial number in the list box.  The resulting data type is a record with a Name and Value field.  Attempting to access the value like this:

 

First(Sort(ComboBox1.SelectedItems.'End Date','End Date',Descending).'End Date').Value results in an error "Name isn't valid. 'Value' is not recognized".  I am sure that I am missing something obvious here but I can't seem to figure this out. Any help is appreciated.

Categories:
  • SueB Profile Picture
    Microsoft Employee on at

    Hi @egraham,

     

    Please try adding the DateValue function to the beginning like this.

    DateValue(First(Sort(ComboBox1.SelectedItems.'End Date','End Date',Descending).'End Date'))

    Let me know the results.

     

    Thank you for using Microsoft Power Platform Communities!
    Sue
    Support Engineer
    Microsoft Power Platform


    If this post helps, then please consider accepting it as the solution to help other members find it more quickly! Have a great day!

  • Verified answer
    Waegemma Profile Picture
    583 Super User 2024 Season 1 on at

    Hi @egraham ,

     

    I use SortByColumns:

     

     

     

     

    First(SortByColumns(ComboBox1.SelectedItems,'End Date',Descending)).'End Date'

     

     

     

     

    This is also possible:

     

     

     

    First(Sort(ComboBox1.SelectedItems;'End Date',Descending)).'End Date'

     

     

     

    Marc 

  • egraham Profile Picture
    21 on at

    Thank you!

    First(Sort(ComboBox1.SelectedItems,'End Date',Descending)).'End Date' ultimately worked for me

  • egraham Profile Picture
    21 on at

    This:
    DateValue(First(Sort(ComboBox1.SelectedItems.'End Date','End Date',Descending).'End Date'))
    Does not work in a date picker control or a list box control.

     

    This: 

     

    DateValue(First(Sort(ComboBox1.SelectedItems.'End Date','End Date',Descending)).'End Date')

     

    Works in a date picker but not a list box control

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard