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 ComboBox by Yea...
Power Apps
Answered

Filter ComboBox by Year and Month

(0) ShareShare
ReportReport
Posted on by 372

Hello, 

 

I have sharepoint list, and it has column 'Target Customer' containing date value (mm/dd/yyyy). I want to filter that column with combobox, but I want to show a date value with format like (mm/yyyy), the list component which has that date (mm/yyyy) will show in gallery. how to do that? 

 

Thank you in advance.

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,731 Most Valuable Professional on at

    Hi @firda59 ,

    Assuming you have the combo box Items displaying mm/yyyy and I have also assumed an output of .Value for it,

    then the filter would be something like

    Filter(
     AddColumns(
     SPList,
     "TargetMY",
     Text('Target Customer', "mm/yyyy")
     ),
     TargetMY = YourComboBox.Selected.Value
    )
     

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • Rajkumar_M Profile Picture
    3,743 Moderator on at

    Hi

    • Add a ComboBox to your screen and set its Items property to the distinct values of the 'Target Customer' column in your SharePoint list. You can use the Distinct function to get the unique values of the column:
                Distinct('Your SharePoint List', 'Target Customer')
    • Set the ComboBox's DisplayFields property to the following formula to display the date value in the desired format:
                Text(Value, "[$-en-US]mm/yyyy") 

           Replace "Value" with the name of the column that contains the date value.

    • Add a Gallery to your screen and set its Items property to the filtered results of your SharePoint list based on the selected value in the ComboBox. You can use the Filter function to filter the list based on the selected value:
             Filter('Your SharePoint List', 'Target Customer' = ComboBox1.Selected.Value)

             Replace "ComboBox1" with the name of your ComboBox.

    • Add the desired controls to your Gallery to display the filtered results.
      With these steps, you can filter your SharePoint list column with a ComboBox and display the date value in the desired format. The Gallery will display the filtered results based on the selected value in the ComboBox.

      Thanks!

      If my response has been helpful in resolving your issue, I kindly request that you consider clicking "Accept as solution" and "giving it a thumbs up" as a token of appreciation.
  • firda59 Profile Picture
    372 on at

    Hi @WarrenBelz 

     

    Thank you, 

     

    but do you know how to display (mm/yyyy) format in combobox?

  • firda59 Profile Picture
    372 on at

    Hi @Rajkumar_404 

     

    it error, do you know how to fix it?

    firda59_0-1690022896323.png

    Thank you

  • WarrenBelz Profile Picture
    153,731 Most Valuable Professional on at

    @firda59 ,

    In the Combo Box Items

    AddColumns(
     RenameColumns(
     Distinct(
     SPList,
     'Target Customer'
     ),
     "Value",
     "Dates"
     ),
     "Value",
     Text(
     Dates,
     "mm/yyyy"
     )
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • firda59 Profile Picture
    372 on at

    Hi @WarrenBelz 

     

    Not error, but show nothing.

    This is my SP list

    firda59_0-1690081767654.png

     

    This is my Apps

    firda59_1-1690081811223.png

     

    Do you know how to fix it? Thank you

  • Verified answer
    WarrenBelz Profile Picture
    153,731 Most Valuable Professional on at

    @firda59 ,

    That is strange as it works fine in my testing - below is a better version with applies Distinct to the MM/YYYY format rather than the full date

    Distinct(
     AddColumns(
     SPList,
     "MonthYear",
     Text(
     'Target Customer',
     "mm/yyyy"
     )
     ),
     MonthYear
    )

    Test result below

    WarrenBelz_0-1690091434591.png

    WarrenBelz_1-1690091461372.png

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

     

  • firda59 Profile Picture
    372 on at

    Hi @WarrenBelz 

     

    thankyou! it works now, I wrote wrong column name😅

    hv a nice day!

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 301 Super User 2026 Season 1

#2
WarrenBelz Profile Picture

WarrenBelz 297 Most Valuable Professional

#3
VASANTH KUMAR BALMADI Profile Picture

VASANTH KUMAR BALMADI 195

Last 30 days Overall leaderboard