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 / Dates in Gallery (as p...
Power Apps
Answered

Dates in Gallery (as per the Date Picker)

(0) ShareShare
ReportReport
Posted on by 2

Hi Folks, 

I have a Seat availability App, where users can see the No of office seats occupied in a particular day.
And there I have a small requirement where we have 2 Date Pickers: From Date and To Date; so whatever dates users pick, in the Dropdown Gallery, we must see the the no of seats occupied against the dates.

So if user pick 7 days, gallery should return 7 rows (if he/she picks 10 days, gallery should return 10 days of data) having 2 columns: Date (in Sorted order) and Occupied seats. I can bring the count of occupied seats according to the dates. But how can I bring the Dates in sorted order?

 

rsinha_2-1657257029497.png

 

The data is coming from SharePoint Lists.

rsinha_1-1657256928415.png

 

Kindly help..

Categories:
I have the same question (0)
  • Verified answer
    rubin_boer Profile Picture
    4,843 Super User 2024 Season 1 on at

    hi there @rsinha you need to do two things, filter the data by your datepickers and then group them where you will get the number of seats.

     

    I created a dataset to reflect the structure you have in some way ;), its called colComSeats

    Step 1

    Filter the data by the datepickers. 

    Filter(
     colComSeats,
     date >= DatePicker1.SelectedDate && date <= DatePicker2.SelectedDate //all the items between this date range
    )

     you can add that to a collection.

     

    Step 2

    group the data above and count the records per date.

    AddColumns(
     GroupBy(
     Filter(
     colComSeats,
     date >= DatePicker1.SelectedDate && date <= DatePicker2.SelectedDate
     ),
     "date",
     "Seats"
     ),
     "No of people...",
     CountRows(Seats)
    )

     

    Result

    Peek 2022-07-09 11-10.gif

    Hope it helps,

    R

  • rsinha Profile Picture
    2 on at

    Thanks @rubin_boer  it's working now.. 🙂

    Thank you for your help..

  • naro_rijal Profile Picture
    12 on at

    Hi @rubin_boer,

    Thanks for the solution, it works!

    But I have a question: Why isn't the gallery showing the end date that I selected on the datepicker?

    The gallery only shows the data from the start date until the day before the end date.

    Here's an example:

    naro_rijal_0-1684981382213.png

     

    I would appreciate your advice.

    Thanks,

    Naro

  • _Nils_ Profile Picture
    71 on at

    Hi @naro_rijal,
    it's because of the time. When selecting a date with the datepicker the time is set to 00:00.

    So you are currently filterting for a timestamp between 5/19/2023 00:00 and 5/24/2023 00:00.

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 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard