web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter Gallery based o...
Power Apps
Unanswered

Filter Gallery based on blank Dropdown Month and Year

(0) ShareShare
ReportReport
Posted on by 40

Hi All,

 

I have 2 dropdown called DrMonth and DrYear and Items for both each dropdown as shown below

 

DrMonth

Items = Sequence(12,1,1)

DrYear

Items = Sequence(12,Year(Now()) - 0,1)

 

Now, I have Sharepoint list column called 'Induction Date' and type is Date & Time.

I have filter my gallery with below code which is working as I expected and I can retrieved the records based on Month or Year I have selected.

but now,  I need to achieved default both dropdown are blank and on Gallery will retrieved all records from SharePoint list.

 

Code

Sort(
 Filter(
 'IT Induction SEA',
 'Induction Date' >= Date(
 DrYear.Selected.Value,
 DrMonth.Selected.Value,
 1
 ) And 'Induction Date' < DateAdd(
 Date(
 DrYear.Selected.Value,
 DrMonth.Selected.Value,
 1
 ),
 1,
 Months
 )
 ),
 'Induction Date',
 Descending
)

 

Thanks 

Categories:
I have the same question (0)
  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @Am4ree ,

     

    Try the following code,

    Sort(
     Filter(
     'IT Induction SEA',
     ( IsBlank(DrYear.Selected) || IsEmpty(DrYear.SelectedItems) || 'Induction Date' >= Date(
     DrYear.Selected.Value,
     DrMonth.Selected.Value,
     1
     )) And 
     ( IsBlank(DrYear.Selected) || IsEmpty(DrYear.SelectedItems) || 'Induction Date' < DateAdd(
     Date(
     DrYear.Selected.Value,
     DrMonth.Selected.Value,
     1
     ),
     1,
     Months
     ))
     ),
     'Induction Date',
     Descending
    )

     

    Hope this helps

  • Am4ree Profile Picture
    40 on at

    Hi @Ethan_R ,

     

    Thank you for your respond.

     

    Have tried your code, however the default drmonth is 1 and dryear is 2023 due i put items Sequence(12,1,1) on drmonth and Sequence(12,Year(Now()) - 0,1) for dryear. when the screen gallery showing all records from month 1 and 2023 year retrieved, what I need to modify on item drmonth and dryear to get blank value?

     

    Thanks

     

    What items i need to be add on drmonth and dryear?

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 419

#2
WarrenBelz Profile Picture

WarrenBelz 397 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 345 Super User 2025 Season 2

Last 30 days Overall leaderboard