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 / Get the last record
Power Apps
Answered

Get the last record

(1) ShareShare
ReportReport
Posted on by 113
I have a sharepoint list that stores updated dates for a specific record from another sharepoint list. I am trying to get the last record that has been submitted for a specific record and I am not sure what to use to get this date. Here is the formula I am using, which returns the date but it not the latest one that was updated. Please help me with the correct formula to use to get the last updated date
 
LookUp('Work Progress Tracker - Revised Target Date', WTTrackerNumber = ThisItem.ID, 'Revised Date')
I have the same question (0)
  • Verified answer
    Radovan Santa Profile Picture
    53 on at

    To get the latest (most recently updated) record from your SharePoint list, LookUp alone is not sufficient because it does not guarantee ordering — it simply returns the first matching record.

    You need to explicitly sort the records by your date column in descending order and then take the first one.

    Here is the correct approach:

    First(
        Sort(
            Filter(
                'Work Progress Tracker - Revised Target Date',
                WTTrackerNumber = ThisItem.ID
            ),
            'Revised Date',
            Descending
        )
    ).'Revised Date'
     

    Explanation:


    • Filter(...)narrows down records to the specific WTTrackerNumber

    • Sort(..., 'Revised Date', Descending)sorts records from newest to oldest

    • First(...)returns the latest record

    • .'Revised Date' extracts the date value from that record
     

    Alternative (more readable with With):

    With(
        {
            latestRecord:
                First(
                    Sort(
                        Filter(
                            'Work Progress Tracker - Revised Target Date',
                            WTTrackerNumber = ThisItem.ID
                        ),
                        'Revised Date',
                        Descending
                    )
                )
        },
        latestRecord.'Revised Date'
    )
     
     

    This ensures you always retrieve the most recently updated date for the given record.

     

    If this solution solved your issue, please consider marking it as the correct answer so others can benefit as well.

  • Suggested answer
    MS.Ragavendar Profile Picture
    7,431 Super User 2026 Season 1 on at
     
    Lookup - will retrieve only one record which cannot suitable for our problem statement.
     
    Dataverse by default has Created and Modified columns so i am filter based on the Modified of every record, If you want filter out my any other column you can use that.
     
    First(
    SortByColumns(
           Filter(
                'Work Progress Tracker - Revised Target Date',
                WTTrackerNumber = ThisItem.ID
            ),
            "modifiedon",
           SortOrder.Descending
        )
    ).'Revised Date'
     
    ✅If this helped, please Accept as Solution to help others ❤️ A Like is appreciated 🏷️ Tag @MS.Ragavendar for follow-ups.
  • 11manish Profile Picture
    3,333 on at
    Use Max() (If data source has  500–2,000 records) otherwise use above suggested

    Max(
        Filter(
            'Work Progress Tracker - Revised Target Date',
            WTTrackerNumber = ThisItem.ID
        ),
        'Revised Date'
    )
     
    Returns:
    Directly the latest date value
  • iKettle Profile Picture
    113 on at
    I have created a variable to store the changed date and I reference this in the date field, however, when I submit the form, the variable value is not showing. Why would that be the case?

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 May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard