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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Gallery Display on Cal...
Power Apps
Suggested Answer

Gallery Display on Calendar Errors

(1) ShareShare
ReportReport
Posted on by 2

Im trying to have a calendar where there is a dropdown menu that filters what is displayed in the gallery.  The different selections in the dropbox are different data tables in Sharepoint.  The columns in each table are all named Start and End.  Trying to get it to look similar to the below with accurate dates for the items:

Dropdown OnChange:

Switch(
    true,
    Dropdown.Selected.Value = "Leave", Set(colCalendarFilter, Leave_1)
    ,Dropdown.Selected.Value = "TDY", Set(colCalendarFilter, Travel_1)
    ,Dropdown.Selected.Value = "Meetings", Set(colCalendarFilter, Meetings_1)
    ,Dropdown.Selected.Value = "Events", Set(colCalendarFilter, 'Event Tracker')
)
 
Gallery Items:
 
Filter(
    colCalendarFilter,
    DateAdd(
        _firstDayInView,
        ThisItem.Value,
        TimeUnit.Days
    ) >= Start
  
    && DateAdd(
        _firstDayInView,
        ThisItem.Value,
        TimeUnit.Days
    ) <= End
)

I can get items to show up like the picture if I comment out everything past the && in Items, but the dates aren't accurate and they continue indefinitely.  It will also work correctly if I link only one source table.  Any ideas on what could be going wrong?

 

 

Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,452 Super User 2025 Season 2 on at
     
    What is the actual issue, that you are not getting data correctly? As you didn't describe how the gallery gets data or what it expects.
     
    So its hard to tell you why a gallery doesn't show what you want, when I do not see pictures showing us when its wrong and an explanation of why the data you use is wrong.
     
    What should the data say
    What does the data say
     
    What is Start
    What is End
     
    looking at your Expression
     
    Should your second one be _firstDayInView?
     
     
    I mean you have essentially the exact same code in BOTH places which means you shouldn't get squat as its going to create the exact same Date, shouldn't your End be out there further??? As everything after the && is exactly the same as before which means...  you have zero milliseconds difference between them so you get no records.
     
    To me thats a bug in your code
     
    Filter(
        colCalendarFilter,
        DateAdd(
            _firstDayInView,
            ThisItem.Value,
            TimeUnit.Days
        ) >= Start
      
        && DateAdd(
            _firstDayInView,
            ThisItem.Value,
            TimeUnit.Days
        ) <= End
    )
     

    If these suggestions help resolve your issue, Please consider Marking the answer as such and also maybe a like.

    Thank you!
    Sincerely, Michael Gernaey
  • WillPage Profile Picture
    2,307 Super User 2025 Season 2 on at
    I've never seen a Switch statement being used like that before.
    Switch(
        Dropdown.Selected.Value,
        "Leave",
        Set(colCalendarFilter, Leave_1),
        "TDY",
        Set(colCalendarFilter, Travel_1),
        "Meetings",
        Set(colCalendarFilter, Meetings_1),
        "Events",
        Set(colCalendarFilter, 'Event Tracker')
    )

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard