Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

PowerApps FilterGallery doesn't work properly

Hi PowerApps experts,

I am using the Service Desk for the template of my project. Everything works well except the FilterGallery. Every time when I click "Tickets older than 3 days," I am getting some tickets that are just one day old. For example, I created two ticket on 4/17/2018 and they show up as Tickets older than 3 days category on 4/18/2018. I cannot find any problems with the code (see below and attached screenshot) in the screen's OnSelect property. Please advise! Thank you.


If(ThisItem.TicketTypes="Tickets older than 3 days",UpdateContext({datetype:Text(DateAdd(Today(), -3)),type:"Tickets older than 3 days"})


Thank you!

Community Support
Community Support

Hi @Shamrock,


I just created one Service Desk template app and I cannot reproduce your issue so far. I see the ticket list in Tickets older than 3 days Gallery are all older than 3 days tickets. 



I just added a new ticket and I will check if it will show here tomorrow.


But I just checked that the original sample app shows the Item property of this Gallery should be:

 If(type="All",Tickets,If(type="Tickets older than 3 days", Filter(Tickets,   DateCreated <> datetype && DateCreated <> Text(Today()), DateCreated <> Text(DateAdd(Today(), -2)),DateCreated <> Text(DateAdd(Today(), -1))|| DateClosed <> datetype && DateClosed <> Text(Today()), DateClosed <> Text(DateAdd(Today(),-2)),DateClosed <> Text(DateAdd(Today(), -1))),If(type="Tickets opened today",Filter(Tickets,datetype in DateCreated),If(type="Tickets closed today",Filter(Tickets,datetype in DateClosed),Filter(Tickets,type in Status)))))

Did you customized this app?




Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-monli-msft,


Thanks for getting back to me! It looks like the Service Desk you have is an older version of the Service Desk.  You may need to use the latest one to see what I am seeing now; the newer version uses "UpdateContext" syntax. I don't know whether the older version has the same problem or not.

No, I didn't change any syntax, just the colors. To be sure, I even tested the untouched Service desk and I'm seeing the same problem -- the new ticket showed up in the "Tickets older than 3 days" category after the second day, and it should have been only 1 day old. Below is the syntax I got from the OnSelect property of the FilterGallery. Please let me know if you need more informaion.


If(ThisItem.TicketTypes="All tickets",UpdateContext({type:"All"}),If(ThisItem.TicketTypes="New tickets",UpdateContext({type:"New"}),If(ThisItem.TicketTypes="Tickets in progress",UpdateContext({type:"In progress"}),If(ThisItem.TicketTypes="Tickets closed",UpdateContext({type:"Closed"}),If(ThisItem.TicketTypes="Tickets on hold",UpdateContext({type:"On hold"}))))));If(ThisItem.TicketTypes="Tickets older than 3 days",UpdateContext({datetype:Text(DateAdd(Today(), -3)),type:"Tickets older than 3 days"}),If(ThisItem.TicketTypes="Tickets closed today",UpdateContext({datetype:Text(Today()),type:"Tickets closed today"}),If(ThisItem.TicketTypes="Tickets opened today",UpdateContext({datetype:Text(Today()),type:"Tickets opened today"}))))

Responsive Resident
Responsive Resident

I just made a new Service Desk app and I'm not seeing the same problem, if I make a new ticket it doesn't appear in the older than 3 days list. And it has the same formula as yours.

Maybe try creating a new app and see if the issue persists.

Hi @Sofie_D,


Thanks for your reply! You will need to check again tomorrow to simulate the probem I have, though. The problem I have is after the second day when the ticket is one day old. Please check again tomorrow and keep me updated. Thank you so much!!!

You might be able to change your system clock to a date in the future to test.

Responsive Resident
Responsive Resident

@ShamrockI added one in the excel file on yesterdays date, and you are right it does show up in 'tickets older than 3 days'. So there's a bug in one of the formulas somewhere.

Helper III
Helper III


I have or had the same probelm. One day old tickets appears in the "3day old Tiecket" filtering.
As I could not find any solution for this topic I've tried something by my self.

It looks like this is working now with the following settings: dont ask me for details, I dont fully understand this filtering.

FilterGallery - Entry
If(ThisItem.TicketTypes="Tickets älter als 3 Tage";
UpdateContext({datetype:Text(DateAdd(Today(); -5));  // <--- changed from 3 to 5

TicketsGallery - Entry
If(type="Tickets älter als 3 Tage";
Filter(Tickets; DateCreated <> datetype && DateCreated <>Text(Today()-1);  //<--- added  -1 
DateCreated <> Text(DateAdd(Today(); -2));
DateCreated <> Text(DateAdd(Today(); -1))|| DateClosed <> datetype && DateClosed <> Text(Today());
DateClosed <> Text(DateAdd(Today(); -2));
DateClosed <> Text(DateAdd(Today(); -1)));

Can someone confirm that??
Is there another/better solution?



Helpful resources

Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,591)