web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter 2 date fields f...
Power Apps
Suggested Answer

Filter 2 date fields from a Sharepoint list in a Gallery

(1) ShareShare
ReportReport
Posted on by 2
Hi I have a Sharepoint list with a date field "Hearing Date" and then i have a calculated field that calculates the date of "Hearing Date" 14 days in advance and it is called Reminder Date.
 
I have found some tutorials on how to display some of this information in Power App Gallery so it looks like a Calendar.
 
I have 2 Galleries;
  1. MonthDayGallery - this displays the days of the month in a calendar view which has been adapted from the Calendar template.
  2. Event - This filters the items in my list and displays the items in the calendar.
    1. On the Event gallery "Items" i have the following
    2. Filter(
          'Scheduler',
          DateAdd(_firstDayInView, ThisItem.Value, TimeUnit.Days) = 'Hearing Date' ||
          DateAdd(_firstDayInView, ThisItem.Value, TimeUnit.Days) = 'Reminder Date'
      )
      But this gives me a delegation warning is there a workaround for this
    3. I have a button in the Event Gallery to display the item's Title with the Text property "ThisItem.Title" to display the items titles in the button
    4. I want to color code the different date fields like Blue for Hearing Date and Yellow for Reminder Date.
    5. I have tried putting in the fill property of the button as the following
    6. If(
          DateAdd(_firstDayInView, ThisItem.Value, TimeUnit.Days) = ThisItem.'Hearing Date',
      Color.Blue,
          If(
              DateAdd(_firstDayInView, ThisItem.Value, TimeUnit.Days) = ThisItem.'Reminder Date',
             Color.Orange
          )
      )
    7. but this does not work
Also I am new to power app so i am not sure where i am going wrong. 
 
Any help is much appreciated 
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,969 Moderator on at
     
    I do love that you did it in a f step format, love it for realz no silliness intended.
     
    However, you didn't actually share your App, and show the code etc.
     
    Filter(
        'Scheduler',
        DateAdd(_firstDayInView, ThisItem.Value, TimeUnit.Days) = 'Hearing Date' ||
        DateAdd(_firstDayInView, ThisItem.Value, TimeUnit.Days) = 'Reminder Date'
    )
     
    Change this to
    
    With(
           {
               HearingDateValue:  DateAdd(_firstDayInView, ThisItem.Value, TimeUnit.Days),
              ReminderDateValue: DateAdd(_firstDayInView, ThisItem.Value, TimeUnit.Days)
          } ,
    
        Filter('Scheduler', 'Hearing Date' = HearingDateValue || 'Reminder Date' = ReminderDateValue)
    )
    
    As for the colors think of 2 things
    1. The fill color and the font color (just called color) or you might not be able to read it.
     
    I assuming you have 2 different text labels or whatever for the Dates? each one needs its own code, in its Fill, and in its Color Property
     
    Just go to the Control in your Gallery that is the Hearing Date and change the Fill to whatever color you want and the Color (font) to whatever color
    Do the same for Reminder Date control
     
    So if you control is called HearingDateTextLabel
     
    Click on the Control
    click ont he Fill property
    set to Color.Blue 
    click on the Color property
    set to Color.White (or something readable)
     
    Do the same for the hearing.
     
    And done :-)
     
     
     
     
  • Suggested answer
    CU05051256-0 Profile Picture
    2 on at
    Hi Michael
     
    Thanks for the suggestion i have tried the below but i am still getting the delegation issue 
     
    With(
           {
               HearingDateValue:  DateAdd(_firstDayInView, ThisItem.Value, TimeUnit.Days),
              ReminderDateValue: DateAdd(_firstDayInView, ThisItem.Value, TimeUnit.Days)
          } ,
        Filter('Scheduler', 'Hearing Date' = HearingDateValue || 'Reminder Date' = ReminderDateValue)
    )
     
    I have attached the app that i am working on and a screen shot, I am focusing on the calendar screen. I got it to work so that i can change months and the events to display,  But because I have 1 button for the events i am looking to find a way to color code the events depending on if it is a reminder or the hearing date.
     
    Thanks
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 577

#2
WarrenBelz Profile Picture

WarrenBelz 440 Most Valuable Professional

#3
Haque Profile Picture

Haque 308

Last 30 days Overall leaderboard