I'm trying to develop an app that filters the gallery based on dates. I have a drop down for users to pick a holiday. For whatever holiday they pick, I'm attempting to filter the gallery based on dates on a SharePoint list. For instance if the user chooses Christmas, I need to filter the gallery to show entries of December 25 for the last 3 years. I'm having issues filtering on more than one date.
Can you give a little more context on your scenario? You stated "filtering on more than one date". Does this mean that users can choose multiple holidays (i.e. Christmas, New Year, etc.) or that you are concerned over the filtering for the last 3 years based on 1 holiday?
Hi @JustFlyRC ,
Filter('SP list', 'Date Column'=DateAdd(dropdown.Selected.Date,1,Years) || 'Date Column'=DateAdd(dropdown.Selected.Date,2,Years) || 'Date Column'=DateAdd(dropdown.Selected.Date,3,Years))
PS: Dropdown.Items resembles this:
If this doesn't make sense, please elaborate on your scenario.
@v-siky-msft , that DateAdd would be forward-looking, FWIW. It would get Holidays for the years after the selected date. I think the OP is looking for previous/all instances of the Holiday existing in the list.
It may not be delegable, but that might not be an issue. Simplest thing would be to break it into the Month and Day components, since Holidays typically have a fixed Month/Day
https://en.wikipedia.org/wiki/Public_holidays_in_the_United_States shows some of the common fixed in the US, for example.
Please see attached sample app for how you could accomplish this by using Month and Day parts.
For rotating Holidays, you'll need an alternate approach.
Learn how to create your own user groups today!
Check out the new Power Platform Community Connections gallery!
Congratulations, the new Super User Season 2 for 2021 has started!
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.