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 / How to show the last 6...
Power Apps
Answered

How to show the last 6 records of the gallery

(0) ShareShare
ReportReport
Posted on by 2

I have the below screen, which have gallery view in which there are 2340 records.

I want to see the last 6 records of the gallery when the screen is opened.

 

Currently we can see that it has 1 to 6 record.

I want that whenever I open the screen - it should show me the records from 2335 To 2340 

 

I cannot apply filter based on the given number, because it will not show the other record, as I want to roll back if required.

 

Please advise how to do it.

 

MIA27_0-1657813694203.png

 

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @MIA27 

    I am assuming that the date showing in your picture would be what would give you the results you are looking for.  In other words, sort your list descending and you will get what you want.

    Example:

    Sort(
     <yourCurrentFilterFormulaHere>,
     <insertNameOfDateColumnHere>,
     Descending
    )

     

    I hope this is helpful for you.

  • MIA27 Profile Picture
    2 on at

    Dear Mr. Randy,

     

    Thank you for your reply.

    the screen shot which I attached was to explain better about the screen.

     

    In actual my gallery is based on the below Item :

    Filter(InqTabA,HistSearch1.Text in InqMach || HistSearch1.Text in InqSerNo)

     

    could not understand how  to apply the descending as shown in your reply.

    Please guide more based on my above filter.

     

    regards

  • RRK736 Profile Picture
    10 on at

    You can apply below formula to show last 6 items of gallery

    LastN( FilteredDatasource, 6)

  • MIA27 Profile Picture
    2 on at

    Dear,

    I applied your advise formula, but disadvantage is that it shows only last 6 records. And does not allow to roll to previous record. This was not my requirement.

     

    My requirement was to show the last records, the screen fits for 6 records, so I wanted those 6 first and then if user wants let them roll back.

    Its same like we use to have the code in VBA - Records.GotoLast, the cursor or view to use to be on the last record.

    Please advise if you have any other idea

  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @MIA27 ,

     

    Please try below if the InqSerNo will be the primary key column:

     

    Sort(Filter(InqTabA,HistSearch1.Text in InqMach || HistSearch1.Text in InqSerNo), InqSerNo, Descending)

     

     

    Just looking into the data source and find the column that you would like the Gallery to be sort by.

     

    Best regards,

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 510

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Vish WR Profile Picture

Vish WR 281

Last 30 days Overall leaderboard