cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rob_G
Helper I
Helper I

Filters with dropdown and sort gallery by date

Hello, in a gallery I established a filter with a dropdown in one of the fields, so far so good. But now I can't figure out how to sort records by date, from oldest to newest.

Database Name: Lic
First Filter: Filter (Lic, '68 Pending Delivery' = Dropdown1.Selected.Value)
Confirm with formula dropdown bar: ["YES", "NO"]

Attached images

 

ThanksImage 01.JPGImage 02.JPGImage 03.JPG,

3 ACCEPTED SOLUTIONS

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @Rob_G ,

Try

Sort(
   Filter (
      Lic, 
      '68 Pending Delivery' = Dropdown1.Selected.Value
   ),
   '50F_Vto_OC',
   Ascending
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

v-qiaqi-msft
Community Support
Community Support

Hi@Rob_G,

 

Based on the issue you mentioned, you want to sort your gallery by date.

 

Generally speaking, it will sort by date on default. When it comes to specific months and days, you may need to set specific expressions.

 

You can try this based on your formula:

 

Sort(Filter (Lic, '68 Pending Delivery' = Dropdown1.Selected.Value), 50F_Vto_OC)

 

Hope this will be helpful.

 

Best Regards,

Qi Qiao

Best Regards,
Qi

View solution in original post

Thanks @Rob_G ,

I am also an old (emphasis) Access man, so I understand, although this one is quite easy in Power Apps. On the Fill property of the card. Your logic has me a bit puzzled as dates before are reg and dates after are green, so how does the 15 days come in?

Anyway, syntax is below with over 15 days green

If(
    '50F_Vto_OC' < Today(),
    Red,
    '50F_Vto_OC' <= Today() + 15,
    Yellow,
    Green
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

6 REPLIES 6
WarrenBelz
Super User
Super User

Hi @Rob_G ,

Try

Sort(
   Filter (
      Lic, 
      '68 Pending Delivery' = Dropdown1.Selected.Value
   ),
   '50F_Vto_OC',
   Ascending
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

v-qiaqi-msft
Community Support
Community Support

Hi@Rob_G,

 

Based on the issue you mentioned, you want to sort your gallery by date.

 

Generally speaking, it will sort by date on default. When it comes to specific months and days, you may need to set specific expressions.

 

You can try this based on your formula:

 

Sort(Filter (Lic, '68 Pending Delivery' = Dropdown1.Selected.Value), 50F_Vto_OC)

 

Hope this will be helpful.

 

Best Regards,

Qi Qiao

Best Regards,
Qi

Thanks @v-qiaqi-msft for confirming my logic.

Yes, Ascending is the default - I generally put it in as a bit of a habit.

@Rob_G , happy to continue the thread to elaborate further if required.

Excellent....

Sort( Filter ( Lic, '68Entrega Pendiente' = Dropdown1.Selected.Value), '50F_Vto_OC', Ascending)

 

PD: 

Now how can I do this ?:
Dates before today are painted red. (Expired date)
Dates with 15 days to expire are painted yellow.
Dates after today's date are painted green. (Date not expired)


I managed to do it in Access, but in Powerapps I can't find how.
Do I need to open another topic?

 

Thank you very much for the support,

Thanks @Rob_G ,

I am also an old (emphasis) Access man, so I understand, although this one is quite easy in Power Apps. On the Fill property of the card. Your logic has me a bit puzzled as dates before are reg and dates after are green, so how does the 15 days come in?

Anyway, syntax is below with over 15 days green

If(
    '50F_Vto_OC' < Today(),
    Red,
    '50F_Vto_OC' <= Today() + 15,
    Yellow,
    Green
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

Fantastic...!

 

Increase the range to 20 days.

If (
     '50F_Vto_OC' <Today (),
     Net,
     '50F_Vto_OC' <= Today () + 20,
     Yellow,
     Green
)

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

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

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

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 (5,578)