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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / how to filter date in ...
Power Apps
Answered

how to filter date in gallery

(0) ShareShare
ReportReport
Posted on by

i have date picker card and saved in excel through patch.

now i want to filter gallery based on Year & month 

i have created dropdown for Year & month.

based on selection of month or year it should filter.

how to do this any idea?

Categories:
I have the same question (0)
  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @venky232,

    What column in excel file you save date picker selected date?

  • venky232 Profile Picture
    on at

    General

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @venky232,

    So you must use Text() function convert date into text string when you use Patch(), right? You should remember the date format, like "dd/mm/yyyy", we will refer to it later.

     

    I think there maybe something date format issue when we extract year from the date, so I would suggest use a foo-like trick, the following formula will always returns the 4 digits of the year.

     

    Right(ThisItem.Date,4)

    For the month filter, I have a dropdown popululate with Sequence(12), and we could also extract the month from the date column like below:

    Right(Left(ThisItem.StartDateGeneral,5),2)

     

    You just need to use the Filter() as below:

     

    Filter(Table1,Dropdown1.Selected.Value=Right(Date,4),Right(Left(Date,5),2)=Dropdown2.Selected.Value)

     

    Note that I set the year dropdown with a Value column including all the year string.

  • venky232 Profile Picture
    on at

    instead of selecting month & year from dropdown ,

    it is possible to use date picker DataCard to select only month & year (without dates)?

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @venky232,

    You could only save the month&Year from the selected date in DatePicker by using 

    Text(DatePicker1.SelectedDate,"mm/yyyy")
  • venky232 Profile Picture
    on at

    my question is

    i want to show only month & year in date picker (without dates) . so user can filter gallery by selecting month &year from date picker instead of dropdown.

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    HI @venky232,

    I thought I have replied this, I used the "could only" word, which means that you could only something format to keep the year and month from DatePciker, but you could not make the DatePicker display only year and month.

  • venky232 Profile Picture
    on at

    filter not working

    Filter(
    Table2,
    Category in varcat || IsBlank(varcat) || varcat = "All",
    Datecolumn=Text(
    DatePicker5.SelectedDate,
    "mm/yyyy"
    )
    )

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @venky232,

    Actually, I am confused what you want to achieve exactly.

    The formula you provided is totally different the formula I provided, I think I have clarified it clearly how I configure the Year dropdown and month dropdow, please check it one more time.

  • venky232 Profile Picture
    on at

    Sorry for confusion, i want to make user selection simply. that's why I'm trying to find alternate solution.

    if we use combobox  instead of Dropdown & date filter with below code will work?

    Filter(Table1,ComboBox1.SelectedItems=Right(Date,4, Left(Date,5),2)) ?

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 490

#2
WarrenBelz Profile Picture

WarrenBelz 427 Most Valuable Professional

#3
Vish WR Profile Picture

Vish WR 381

Last 30 days Overall leaderboard