cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

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
Highlighted
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
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,767)