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 / Show Public Holiday on...
Power Apps
Unanswered

Show Public Holiday on Custom Calendar

(0) ShareShare
ReportReport
Posted on by 28

Hi

 

I have a custom calendar and I am trying to indicate the public holidays that comes from a SharePoint list. 

 

So I have the following to show me the current day that works perfect:

OnSelect : Set(_DateSelected,DateAdd(_FirstDayofWeek,ThisItem.Value,TimeUnit.Days))

OnVisible: If(DateAdd(_FirstDayofWeek,ThisItem.Value) =_DateSelected,true,false)

 

But If I want to change it to do a Filter to check if today is a Public Holiday I can't seem to get that working..

 

OnSelect: Set(_DateSelected,DateAdd(_FirstDayofWeek,ThisItem.Value,TimeUnit.Days))

OnVisible: If(Filter(MICT_TC_Public_Holidays, Start_Date <= DateAdd(_DateSelected,0,TimeUnit.Days)
&& End_Date >= DateAdd(_DateSelected,6,TimeUnit.Days)),true,false)

 

I tried this and various others but I cant seem to get this right.

 

Any advice ?

 

Thanks 

C

Categories:
I have the same question (0)
  • Rajkumar_M Profile Picture
    3,741 Super User 2025 Season 2 on at

    Hi @Charl 

     

    You should use the TemplateFill property of the gallery items or another visual indicator within the gallery template to change the appearance of the item if it represents a public holiday.

     

    If(
    CountRows(
    Filter(
    colPublicHolidays,
    Start_Date <= DateAdd(_FirstDayOfWeek, ThisItem.Value, Days) &&
    End_Date >= DateAdd(_FirstDayOfWeek, ThisItem.Value, Days)
    )
    ) > 0,
    Color.Red, // This color indicates a public holiday
    Color.Transparent // Default color when it's not a public holiday
    )

     

    Thanks!

     

    If my response has been helpful in resolving your issue, I kindly request that you consider clicking "Accept as solution" and "giving it a thumbs up" as a token of appreciation.

     

  • Charl Profile Picture
    28 on at

    Hi Thanks for the reply. Sorry to say still having issues. the If statement is expecting true/false so does not like the Color.Red.. I have tried few changes but basically getting same issue.

     

    Charl_1-1714487060167.png

     

  • Verified answer
    Rajkumar_M Profile Picture
    3,741 Super User 2025 Season 2 on at

    Try this formula,

     

    If(
    CountRows(
    Filter(
    MICT_TC_Public_Holidays,
    Start_Date <= DateAdd(_FirstDayOfWeek, ThisItem.Value, TimeUnit.Days) &&
    End_Date >= DateAdd(_FirstDayOfWeek, ThisItem.Value, TimeUnit.Days)
    )
    ) > 0,
    Color.Red, // This color indicates a public holiday
    Color.Transparent // Default color when it's not a public holiday
    )
  • Charl Profile Picture
    28 on at

    Thank you @Rajkumar_404 I am learning 😁 !!

  • Rajkumar_M Profile Picture
    3,741 Super User 2025 Season 2 on at

    Happy Learning 😇 !!!

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard