Showing results for 
Search instead for 
Did you mean: 
Advocate II
Advocate II

Nested gallery filters with dependent logic

Hi everyone,


I am trying to build a basic printable calendar for a non-profit disability support organisation. Their rostering system can't output printable rosters in a format which is understandable to people with intellectual disabilities so I am trying to build something. Their rostering system spits-out a couple of CSV reports which can be copy-pasted into a SharePoint list then manipulated by PowerApps.


Once of the lists contains a list of events, each having a "date of first event" as well as various frequencies (ie once, weekly, fortnightly, monthly, etc).

In PowerApps, the printable calendar has 'squares' for each day which are a gallery and should display a list of events for that day (so there will be 28 galleries in a calendar layout). There is a single date picker at the top of the screen which sets the first Monday of the month to print.

I am having trouble with the logic for each square (gallery). 

I want it to show the following:

If the frequency of the event is "Once", event start date = datepicker (or datepicker+1, datepicker+2, etc)

If the frequency is "Weekly", event start date = datepicker OR Weekday(event start date) = Weekday(datepicker)

then Fortnightly If event start date = datepicker OR event start date = day of week && datediff(calendardate to event start date ) / 14 = x.0 (whole number)

If the frequency is "Monthly",event start date = datepicker OR Event start date (day only) = datepicker (day only) - i.e. 26th

If the frequency is "Annually", event start date = datepicker OR Event start date (day&month only) = calendardate (date&month only) - i.e. 26th May


I hope the goal makes sense?

This is the code so far (be kind):

//show only events for selected roster name
Filter(RosterEvents,ParticipantRosterName = ComboBox1.Selected.Result,

//also show one-off events on this tile's date
EventFrequency = "Once"&&
Text(DateTimeValue(Text(DatePicker1.SelectedDate+1)), "[$-en-US]dd/mm/yyyy") = Text(DateTimeValue(Text(EventStartDate)), "[$-en-US]dd/mm/yyyy")

//also show weekly events falling on this day of the week
EventFrequency = "Weekly" &&
Text(DateTimeValue(Text(DatePicker1.SelectedDate+1)), "[$-en-US]dd/mm/yyyy") = Text(DateTimeValue(Text(EventStartDate)), "[$-en-US]dd/mm/yyyy") ||
Weekday(DateTimeValue(Text(EventStartDate))) = Weekday(DateTimeValue(Text(DatePicker1.SelectedDate+1)))

//also show events falling on this day of the fortnight

//also show events falling on this day of the month

//also show events falling on this day of the year


Having the logic in this order doesn't work, it obviously just evaluates everything. 

Can anyone give me some pointers on how to order/layout the logic to acheive this?


Any help is very much appreciated and will help many people living with a disability.


Helpful resources

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,235)