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 III
Super User III

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 III
Super User III

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 @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.

 

View solution in original post

Fantastic...!

 

Increase the range to 20 days.

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

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (3,176)