cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
F_Quint
Helper IV
Helper IV

Filter Event gallery by selected date

My calendar has an event date range of 08/28 - 08/31,  and for the start date my Gallery shows the event, but when I click on any other date within that range Nothing shows. 

 

My Gallery Items formula: SortByColumns(Filter(Navia_PTO_Calendar, Text(Start_Date, DateTimeFormat.ShortDate) = Text(_dateSelected, DateTimeFormat.ShortDate)), "Start_Date")

 

how can I tweak it for it to show the event for all that date range?

 

Thank you for your help. 

 

Navia_calendar1.jpgNavia_calendar2.jpg

 

1 ACCEPTED SOLUTION

Accepted Solutions

@F_Quint 

Ok, I see. So my guess is that when a calendar date is selected the variable _dateselected gets set, is that correct?

 

If so, you can rewrite your gallery filter like this ( in pseudo code)

 

...Filter(myList, StartDate <= _dateselected, EndDate >= _dateselected) ...

 

Not sure if you are aware of this but Dates are now delegatable when filtering SharePoint lists, meaning you don't need to use dates as Text or Number types to filter your lists. Because I don't know the data types you are using for your dates I don't know if this will help but thought I'd mention it anyway.

 

I can help to rewrite the full filter code if you like just let me know.

View solution in original post

4 REPLIES 4
Eelman
Super User
Super User

@F_Quint 

Without seeing your dataset, my guess is that Start_Date is the wrong Filtering field. What are the Red dots for? How are they generated? That is probably where you need to look for you filtering answer

@Eelman 

 

My data source is a SharePoint List with Start_date, End_Date, and Resource_Name columns

 

the red dots show that there's an event scheduled on that day. I set the circle's on visible property to:

 

CountRows(Filter(Navia_PTO_Calendar,DateValue(Text(Start_Date))<=DateAdd(_firstDayInView,ThisItem.Value,Days),DateValue(Text(End_Date))>=DateAdd(_firstDayInView,ThisItem.Value,Days)))>0&&!Subcircle1_3.Visible&&Title3_3.Visible

 

In this example, the event is from 08/28 to 08/31

@F_Quint 

Ok, I see. So my guess is that when a calendar date is selected the variable _dateselected gets set, is that correct?

 

If so, you can rewrite your gallery filter like this ( in pseudo code)

 

...Filter(myList, StartDate <= _dateselected, EndDate >= _dateselected) ...

 

Not sure if you are aware of this but Dates are now delegatable when filtering SharePoint lists, meaning you don't need to use dates as Text or Number types to filter your lists. Because I don't know the data types you are using for your dates I don't know if this will help but thought I'd mention it anyway.

 

I can help to rewrite the full filter code if you like just let me know.

View solution in original post

@Eelman  That works like a charm. Much appreciated!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (20,862)