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 / Show only latest recor...
Power Apps
Unanswered

Show only latest records from Dataverse Table

(0) ShareShare
ReportReport
Posted on by 153

One of my Dataverse table has multiple versions of each ID with different LastModifiedDate. Is there a way to create a View in Dataverse Table to show only latest version for each record?

 

I'm using this data in Powerapps I tried doing same from that side but without using GroupBy & Distinct it doesn't seems possible & which also creates Delegable issue.

 

Thanks

I have the same question (0)
  • Ram Prakash Duraisamy Profile Picture
    5,593 Super User 2025 Season 2 on at

    Hi @addy2019 

     

    You can simply use Last or First to get the record for the same.

     

    First(SortByColumns(TableName,LastModifiedDate,Descending))

     

    Please mark as Answer if it is helpful and provide Kudos


    Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
    Follow me on Twitter : @rampprakashd
    Blog : https://microsoftcrmtechie.blogspot.com

  • addy2019 Profile Picture
    153 on at

    Hi @rampprakash ,

     

    As I mentioned I need latest of every record (ID) not the FIRST record

  • Ram Prakash Duraisamy Profile Picture
    5,593 Super User 2025 Season 2 on at

    Hi @addy2019 

     

    We are Using Sort By Descending and taking the First Record,

     

    Else you can use Ascending and Take the Last Record:)

     

    Please mark as Answer if it is helpful and provide Kudos


    Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
    Follow me on Twitter : @rampprakashd
    Blog : https://microsoftcrmtechie.blogspot.com

  • addy2019 Profile Picture
    153 on at

    Hi @rampprakash ,

     

    Let me explain again, after Sorting (Asc or Dsc) if you do First() it will give you ONE record only. If you do FirstN()  it will give you as many records as you mention. My Problem is not that.

     

    I have big dataset with less than half a million records with unique ID's I want latest record for each ID.

  • xxxx12345 Profile Picture
    19 on at

    Hi iam facing the same issue have you found out the solution?

  • xxxx12345 Profile Picture
    19 on at

    hi @addy2019 @rampprakash 

     i want to get the latest record of each user or id only to display in the table.Such in case every user creates  3 to 4 items in a day means i want one recent item of every user to be displayed 

  • addy2019 Profile Picture
    153 on at

    Hi Ram,

     

    This project of mine went into standby due to other priorities therefore I couldn't follow up. But before that I tried many different options which I couldn't recall now. But I'll be resuming it soon & will start from where I left off. Meanwhile I kept it open just in case someone has any inputs. I'll share with you my findings once I resume but I hope you'll find your answers before that.

     

    Sorry to disappoint you.

     

    Thanks

    Apoorv

  • john_wilder_ds Profile Picture
    4 on at

    Hi @addy2019 / xxxx12345,

    I do this using a Spark SQL query, joining the table back onto itself to compare. In the example below I use the 'versionnumber' column as the comparison but you can use the same logic with the 'LastModifiedDate' column too.

    SELECT t1.* 
    FROM YourTableName t1
    LEFT JOIN YourTableName t2 ON t1.id = t2.id and t1.versionnumber < t2.versionnumber
    WHERE t2.id IS NULL

    To explain a little further, what we are saying here is:

    For each record, check the table again and look for other records with the same ID and a higher version number.

    (or later Modified Date in your example)

    If there are none of these (t2.id IS NULL) then we know we have the most recent version of this ID.

     

    Hope that helps. Please mark as Answer if you are satisfied with this response.

    Thanks!

  • john_wilder_ds Profile Picture
    4 on at

    @rampprakash See also above 🙂

  • tagiobahee Profile Picture
    2 on at

    This works. Tanks.

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard