cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RLangdell
Level: Powered On

Filter on date but with blanks on top

Hi all,

 

I have been trying to wrap my head around this but I have the following sort which organises my gallery by date, which i perfect. However, I would like all records where the VehicleReturnedDate is blank to show at the very top. How can I achieve this?

 

Sort(Filter(tbl_Usage,VehicleUsed=selectedVehicle.VehicleReg),VehicleReturnedDate,Descending)
1 REPLY 1
Super User
Super User

Re: Filter on date but with blanks on top

@RLangdell 

Unforuntaely, no matter which way you sort Blanks always appear at the bottom. Therefore I hope you are OK with collections because using them is necessary to achieve your goal.  Put this code in the OnVisible property of your screen or any other behaviour based property (which starts with the word "On")

 

ClearCollect(
myGalleryCollection,
Filter(tbl_Usage,
VehicleUsed=selectedVehicle.VehicleReg,
VehicleReturnedDate=Blank()
)
);
Collect(
myGalleryCollection,
Sort(
Filter(
tbl_Usage,
VehicleUsed=selectedVehicle.VehicleReg,
VehicleReturnedDate<>Blank()
),
VehicleReturnedDate,
Descending
);

 

And then put this code in the Items property of your gallery.

 

myGalleryCollection

 

Let me know if you have questions.

 

---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (7,438)