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 / Distinct, Sort by Colu...
Power Apps
Answered

Distinct, Sort by Column in Combobox to filter a Gallery

(0) ShareShare
ReportReport
Posted on by 1,512

I have a combobox in my app to help with filtering my gallery.

 

I have this code in the items property of the gallery

If(
 IsBlank(ComboBox2.Selected.Title),/* <-- Modify formula here */
 'Calendar @Grant',
 SortByColumns(
 Filter(
 'Calendar @Grant',
 Title in ComboBox2.SelectedItems.Title
 ),
 "EventDate",
 Ascending
 )
)

 It is not sorting by the eventdate and my list is all out of order, as well as pulling in the wrong date that do not match my SharePoint list.  I have checked my regional settings and they are set correctly.

 

I cannot figure out what is going on.

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Dorinda 

    How is EventDate defined in your datasource - text or a date?

  • Dorinda Profile Picture
    1,512 on at

    As a Date

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Dorinda 

    Let's first get your formula cleaned up a bit.

    Change to:

    SortByColumns(
     Filter(
     'Calendar @Grant',
     IsBlank(ComboBox2.Selected.Title) || (Title in ComboBox2.SelectedItems.Title)
     ),
     "EventDate",
     Ascending
    )

    Chances are that returns the same thing you are seeing, but let's put that in first and then, let me know if you see any particular pattern to the sorting.

  • Dorinda Profile Picture
    1,512 on at

    @RandyHayes  once again you fixed it for me, but I am still having the issues where dates are not appearing as they should 

    Dorinda_0-1642445841459.png

     

    Dorinda_1-1642447000058.png

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Dorinda 

    It appears sorted properly. 

    However, it does appear that one calendar is looking at one source and your list of events is looking at something totally different.

  • Dorinda Profile Picture
    1,512 on at

    @RandyHayes  thats what I am saying they are both looking at Event Date, but the SharePoint calendar is displaying it correctly on Thursday but the Power Apps is putting it on Wednesday and I cant figure out why

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Dorinda 

    Ah I see, you're only looking for the ones with PayDate.

    So it is probably all good, it is just that the timezone information stored in the record is putting is a couple hours back...which would put it in another day.

    Show the Start Time in your gallery and see what it is showing for the Date and Time of that event.

  • Dorinda Profile Picture
    1,512 on at

    Can anyone help me figure out why my dates are showing weird, I have checked the SharePoint list and the regional settings and both are correct.

     

    I really need to get this fixed.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Dorinda 

    If you're looking to pass this off to someone else, then you might want to post again as posts that have responses don't get viewed as much as new ones.

     

    I had asked you in the last post to try something, but if you're not able to do that, then I would repost this for other options.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Dorinda 

    So in review - I see that you do actually have what I was looking for in the list - the time.

     

    I am seeing that Payday is listed as 5:00 PM.  If you look at that event in your actual calendar - Is that the actual start time listed?  My guess is that it is listed as an entire day event. And, since your in Pacific time, that would be offset from UTC to be 5:00 PM.

    So, check the real event and see what start time it has.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard