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 / Click on a calendar to...
Power Apps
Answered

Click on a calendar to be directed to the corresponding page

(0) ShareShare
ReportReport
Posted on by 691

Hello, On a screen I created a Gantt chart that displays different events depending on the time as you can see below  :

s44_1-1659611297772.png


All my events are stored in a SharePoint list called "Provider2".

s44_2-1659611321305.png

Usine : Text type

DateArrivee : Date and Hour type

DateFin : Date and Hour type

Status : Choice type

 

 

On another screen, I created a calendar which is this one:

s44_0-1659624972385.png

But I have a problem. I would like that when the user clicks on a calendar date, it redirects him to the Gantt chart page corresponding to the date. For example, if I click on August 5th, I would like it to show me the Gantt chart page with all the events scheduled for August 5th.

But I can't do this and I've been stuck on it for several days. Can you help me please? Thanks in advance !

 

 

-------------------------------

 

Gantt Chart Screen : 

 

s44_3-1659611668002.png

In red, it's my gallery which contains all the hours.
In blue, it's my gallery which contains all my items.
In fushia, it's my gallery that displays all the columns for the hours.

 

 

lblIndicator_1 :

 

 

 

 

Fill : If(
 ThisItem.Status.Value="Not Started";
 White;
 ThisItem.Status.Value="Active";
 Orange;
 ThisItem.Status.Value="Delayed";
 Red;
 ThisItem.Status.Value="Completed";
 Green;
 Gray
 )



X : Value(
 DateDiff(
 Date(
 Year(ThisItem.DateFin);
 Month(ThisItem.DateFin);
 Day(ThisItem.DateFin)
 );
 ThisItem.DateFin; Hours
 ) 
)* (galBodyMonths_1.Width / 24)



Width : (Value(
 DateDiff(
 Date(
 Year(ThisItem.DateFin);
 Month(ThisItem.DateFin);
 Day(ThisItem.DateFin)
 );
 (ThisItem.DateFin); Hours
 )
) -
Value(
 DateDiff(
 Date(
 Year(ThisItem.DateArrivee);
 Month(ThisItem.DateArrivee);
 Day(ThisItem.DateArrivee)
 );
 ThisItem.DateArrivee; Hours
 ) 
) 
) +1 * (galBodyMonths_1.Width / 24)

 

 

 

 

 

 

 

Calendar Screen : 

 

s44_1-1659625289120.png

 

 

 

Categories:
  • Hii_iii Profile Picture
    691 on at

    .

  • Verified answer
    rubin_boer Profile Picture
    4,843 Super User 2024 Season 1 on at

    hi @s44 

     

    consider this:

     

    this data is retrieved when you select the calendar date,  something like Filter(yourData, dateArriv >= SelectedDateInCal && dateFin <= SelectedDateInCal)

    Data

     

    ClearCollect(colGantt,
     {__name: "a", __start: 10, __end: 12, __stat: "active"},
     {__name: "b", __start: 14, __end: 18, __stat: "delayed"},
     {__name: "c", __start: 07, __end: 08, __stat: "completed"}
    )

     

     

    Gannt Hour header (Gallery)

     

    ForAll(Sequence(24,0),{_hour: Text(Value,"#00") &":00"})

     

     

    Add two galleries

    Gal1:  Blank vertical

    Gal2: blank horizontal (sub/child gallery to Gal1)

     

    add the status to see if time is booked, where the time starts and status of the "project"

     

    With(
     { __Object: LookUp(colGantt, __name = lblSelectedName.Text)},
     
     AddColumns(
     ForAll(Sequence(24,0),{_hour: Value}), 
     "_booked", //this is true is the value is between the start and end hour
     And(
     _hour >= Value(Left(__Object.__start, 2)) , 
     _hour <= Value(Left(__Object.__end, 2))
     ),
     "_stat", //status of the projetc
     ThisItem.__stat,
     "_firstcol", //the first hor when this is true, to be used later
     _hour = Value(Left(__Object.__start, 2))
     )
    )

     

     

    Galleries design, i will leave that up to you

     

    Gal1:

    add two labels

    lbSelectedStatus: ThisItem.__stat // to determine the color code later

    lblSelectedName = ThisItem.__name //to highlight the project name later and to do come conditional statement in Gal2

     

    Gal2

    Add the first code bit to the Items = With(
    { __Object: LookUp(colGantt, __name = lblSelectedName.Text)},... //as above 

    Add a labelt to the Gal2

    Size the label as you need

    Set the Fill as you need, here i used (_booked and _stat are those columns added above)

     

    Switch(true,
     ThisItem._booked && ThisItem._stat = "active", Orange,
     ThisItem._booked && ThisItem._stat = "delayed", Red,
     ThisItem._booked && ThisItem._stat = "completed", Green,
     White
    )

     

     

    Last step

    set the Text = If(ThisItem._firstcol, lblSelectedName.Text) //if it i sthe first hour the project name will display

     

    Result

    gannt.gif

     

    Hope it helps,

    R

     

     

     

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard