cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Hooi
Helper I
Helper I

Calendar view in Power App show only event with date range

Hello all, 

 

I need helps with the Power Apps formula. I have created a calendar in Power Apps and want to show the event listed in SharePoint List. Screen 1 will be my calendar in Power Apps and Screen 2 is the SharePoint List with three events. 

 

I am using the Filter function to help me show the events.

Here is my formula : Filter(Calendar, ('EndTime' >= DateAdd(_FirstDayInView, ThisItem.Value)) && ('StartTime' <= DateAdd(_FirstDayInView, ThisItem.Value)))

 

However, as you can see the calendar only shown the event with the date in range but not the first event with the same start and end date. Can someone please help me to find out what is the problem of the formula? 

 

Screenshot 1 

Hooi_0-1641874603345.png

 

 

Screenshot 2 

 

Hooi_1-1641874644733.png

Hooi_2-1641874644853.png

 

Hope someone can helps. Thank you so much! 

 

Regards, Hooi 

 

5 REPLIES 5
AJ_Z
Super User
Super User

Have you tried:

 

Filter(Calendar, Or(And('EndTime' >= DateAdd(_FirstDayInView, ThisItem.Value) , 'StartTime' <= DateAdd(_FirstDayInView, ThisItem.Value)),'EndTime' = DateAdd(_FirstDayInView, ThisItem.Value) , 'StartTime' = DateAdd(_FirstDayInView, ThisItem.Value)))

 

Let me know if that is what you wanted/is your solution if it does not work could you let me know what _FirstDayInView is as I have just wrote a solution based on what I assumed it is so if it doesn't work it is likely my assumption of what it was is incorrect 🙂



Signature:


If you appreciated my comments/responses please be sure to Like/Kudo them it really does make me smile 🙂 !
Link to the Power Platform Professionals United Kingdom User Group:

https://powerusers.microsoft.com/t5/Power-Platform-Professionals/gh-p/PowerPlatformProfessionalsUnit...

Hooi
Helper I
Helper I

@AJ_Z , 

 

Thanks for the reply. The formula you provided doesn't work. _FirstDayInView is to show the date of the first box of the month. For Jan 2022 is 26th Dec 2021

 

Hooi_0-1641877392447.png

 

Thanks!

Ah thanks for explaining that before i fix it can you let me know what the Value is in the gallery as we do DateAdd(_FirstDayInView, ThisItem.Value)

so here we are adding days to the first day to get the current day in the gallery is that right?



Signature:


If you appreciated my comments/responses please be sure to Like/Kudo them it really does make me smile 🙂 !
Link to the Power Platform Professionals United Kingdom User Group:

https://powerusers.microsoft.com/t5/Power-Platform-Professionals/gh-p/PowerPlatformProfessionalsUnit...

Hi @AJ_Z 

 

Not sure if I got you right, the value of the gallery is Calendar.WeekShort()

 

Hooi_0-1642134809190.png

 

Thanks for getting back to me but that is the items / datasource for another gallery to show the days. i am looking to know what ThisItem.Value is for this part e.g. the other gallery 

AJ_Z_0-1642151635292.png

AJ_Z_1-1642151847603.png

 

So ii think i am asking you to show me this information for this gallery:

AJ_Z_2-1642151937481.png

 

 

 

 



Signature:


If you appreciated my comments/responses please be sure to Like/Kudo them it really does make me smile 🙂 !
Link to the Power Platform Professionals United Kingdom User Group:

https://powerusers.microsoft.com/t5/Power-Platform-Professionals/gh-p/PowerPlatformProfessionalsUnit...

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

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