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 / Find the last record t...
Power Apps
Answered

Find the last record that match a name from another column

(0) ShareShare
ReportReport
Posted on by 22

Hello;

 

I'm creating an app to help keep track  changes of product container, each product container has a different lot number, but will have the same name.

 

What I want to do is to show the lot code of the last product name that was used before replacing it for a new product container.

 

The table looks like this.

product -namelot-number
product11234
product21235
product3 1236
product2 1237
product1

1238

 

I would like to find product product2 and return on the text box the lot code that will be 1237, but my current formula just return the first record matching that name.

 

 

 

 

If(Dropdown1.Selected.Value ="Old Container",LookUp(dataSource,product-name = Dropdown2.Selected.Value,lot-number) & If(Dropdown1.Selected.Value = "New Container", ScanResult))

 

layout.PNG

 

 

 

 

 

 

 

 

The search will be based on the Dropdown2 value.

 

Thanks for your help.

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    156,421 Most Valuable Professional on at

    Hi @Sabier ,

    Try this - note the With() statement is only to avoid a Delegation warning on the First() statement

    With(
     {
     wProduct,
     Sort(
     Filter(
     dataSource
     'product-name' = Dropdown2.Selected.Value
     ),
     'lot-number'
     Decending
     ).'lot-number'
     },
     First(wProduct)
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Vijay Tailor Profile Picture
    2,961 on at

    Hi @Sabier ,

    as per my understanding see the below approach.

    Hope to help you to resolve your issue.
    use the Filter Instead of Lookup and so you can sort data based on the last ID like descending ways.

    First(SortByColumns(Filter(TestAkshay,MyUser.DisplayName<>Blank()),"ID",Descending))


    Thanks,
    Vijay

    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."-Vijay



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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard