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 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

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,413)