Showing results for 
Search instead for 
Did you mean: 
Post Prodigy
Post Prodigy

DatePicker used in optional not as obligatory



In my last topic ( I received a help in making my DatePicker works in my gallery.

This is the function:


Text(Utworzony;ShortDate) = Text(DatePicker1.SelectedDate;ShortDate)); 
Utworzony; If(SortDescending2;Descending;Ascending))



I use in my gallery SearchBox that i searching true filds Name/Description (Nazwa/Opis), and a button that lists all gallery records desc/asc of date.


I also added DatePicker1 that I wanted to use an additional source of possible filters.

This filter is however very problematic, because it is not optional - it filter the data in default mode.


So for example my gallery has 30 records - after implementing in Items of gallery updated function with listed DataPicker it only shows today records. When I delete value Today() it shows no records at all.

At this moment I have no means to show all RECORDS.


What I intented was to create a new filter that would help my users filter some data, but that would be optional not obligatory.

Is it possible to change this filter?


I thought that maybe I could use two DataPickers one would be start date of filter which would be set on 01.01.1900 and another would be Today() on default.

So it will list all records, but also allow users to search when they need.


Or maybe is there other way to achieve it? 

I found this function but I have troubles in implementing it in my formula:

I created DatePicker2

Filter(DataSourceName, EventDate > DatePicker1.SelectedDate && EventDate < DatePicker2.SelectedDate)

Thank you for your help.



I marked this as solution, but it is bugged and I believe it is PowerApps bug.

If I set DatePicker2 on Today() it will be one day off. So for example if there are records made on 22.09 it will show all records up to 21.09. I set DatePicker1 on as early as possible by default. Leaving it blank shows date 01-01-1970, but I tested many variations. DatePicker1 works OK, but DatePicker2 isn't.


I found this topic:


Hi, I encountered this too when my datepicker is set to UTC. OnVisible, it is set to 'TODAY', but it will always return the current date minus 1. So here is the workaround that I did, I set the default value of the datepicker to 'SelectedEventDate' and placed the code below on the OnVisible property of the screen:


UpdateContext({SelectedEventDate: DateValue(Text(Today(),DateTimeFormat.UTC))+1 })


I used this solution from that topic - but it works partially - it is by default setting a DatePicker2 on date that allows it to search well, but this date is one day ahead! So with this function Today() is 23.09.2020.


Using DatePickers like that is really confusing. My users will have to be aware that the filter is one day off.

Is there any workaround?


When I use your solution - when gallery open it is missing records when DatePicker2 is Today(). When I use this workaround DatePicker2 is one day ahead and it is very confusing but at least functional.


Please kindly advise if you have idea what to do.


Helpful resources

PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!


Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (15,105)