Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Create Gantt Chart

(0) ShareShare
ReportReport
Posted on by 691

Hello, I am trying to create a diagram similar to the picture below.

s44_0-1659362916928.png

 

But I can't, when I try I don't have the colored bars displayed.

I have something like that :

s44_1-1659363217038.png

 

 

All properties that I have :

 

Indicator Label : 

s44_2-1659363251043.png

 

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

X : Value(StartDays.Text) * 'Gantt Tasks_1'.Width/365

 

EndDays Label :

s44_3-1659363453595.png

Text : DateDiff(Date(Year(Now());1;1); DateValue(EndDate.Text))+1

 

EndDate Label :

s44_4-1659363505307.png

 

StartDays Label :

s44_5-1659363564101.png

 

DateDiff(Date(Year(Now());1;1); DateValue(StartDate.Text))+1

 

StartDate Label :

s44_6-1659363599909.png

 

Can you help me please ? Thanks in advance 😞 !

  • iAm_ManCat Profile Picture
    18,206 Most Valuable Professional on at
    Re: Create Gantt Chart

    Excellent, glad I could help!

     

    One minor fix:

    lblIndicator.X

    change to:

    Value(
     DateDiff(
     Date(
     Year(Now()),
     1,
     1
     ),
     ThisItem.StartDate
     ) + 0
    )* (galBodyMonths.Width / 365)

    and 

    lblIndicator.Width:

    (Value(
     DateDiff(
     Date(
     Year(Now()),
     1,
     1
     ),
     ThisItem.EndDate
     ) + 1
    ) - Value(
     DateDiff(
     Date(
     Year(Now()),
     1,
     1
     ),
     (ThisItem.StartDate + 0)
     )
    )) * (galBodyMonths.Width / 365)

     

    This should fix them starting too far from left and the gaps between items 🙂

  • s44 Profile Picture
    691 on at
    Re: Create Gantt Chart

    It's work thank you ! C:

  • s44 Profile Picture
    691 on at
    Re: Create Gantt Chart

    It's work !

  • iAm_ManCat Profile Picture
    18,206 Most Valuable Professional on at
    Re: Create Gantt Chart

    If you select the error notification it will take you to the formula that is erroring - this will likely be the name of the list, the names of the startdate and enddate columns, the status, and the description(title).

     

    You will need to change these to match the naming and column types of your datasource

  • s44 Profile Picture
    691 on at
    Re: Create Gantt Chart

    s44_2-1659435361347.png

     

     

    I recovered the file but I can't adapt it with my SharePoint data :c @iAm_ManCat 

  • Verified answer
    iAm_ManCat Profile Picture
    18,206 Most Valuable Professional on at
    Re: Create Gantt Chart

    Yeah, that's not a great tutorial to be honest, their naming convention is poor and they have way too many unnecessary items.

     

    I will put together a blog on this sometime soon, but there's the test .msapp I created as a proof of concept - you can use File> Open to browse for this .msapp file and then open it - those few labels and galleries are what you need for a basic gantt - feel free to copy them out of that app into your own.

     

    image.png

     

    Any issues copying it to your App then please let me know,

     

    Ciao,

  • s44 Profile Picture
    691 on at
    Re: Create Gantt Chart

    As you can see in my post, this is exactly the tutorial I followed but it doesn't work as you can see 😕 @iAm_ManCat 

  • iAm_ManCat Profile Picture
    18,206 Most Valuable Professional on at
    Re: Create Gantt Chart

    oh, well he included the actual .msapp so that you could copy out the contents and modify it for your own needs rather than a full tutorial

     

    You can look at this tutorial for a step-by-step:

    GanttChart Using Microsoft PowerApps (c-sharpcorner.com)

  • s44 Profile Picture
    691 on at
    Re: Create Gantt Chart

    I saw it but I didn't understand. His tutorial is way too complex for me 😕

  • iAm_ManCat Profile Picture
    18,206 Most Valuable Professional on at
    Re: Create Gantt Chart

    Hi,

     

    To save you some time - Someone has already gone through the trouble of doing this so you don't have to - you can get it from the community samples here and then tweak it for your needs:

     

    Gantt-like Display Using Standard Power Apps Contr... - Power Platform Community (microsoft.com)

     

    Cheers,

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,679 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard