cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ojack21
Level: Powered On

Create a Pie Chart that Show Only New and On Going Project

hello everyone,

 

does anyone has an idea how i can get the right result for this one? I have a table with Completed, In Progress and New projects. I want to create a Pie Chart that will show only the On/Off Track In Progress and New projects. So far, all my attempts always include even the Completed projects.

 

Appreciate everyone's help here. thank you. 🙂Capture.JPG

 

1 ACCEPTED SOLUTION

Accepted Solutions
Edwin-Abdalian
Level 10

Re: Create a Pie Chart that Show Only New and On Going Project

I used a different approach and created a few collections to prepare my data for the chart. of course you can combine some of the steps but I'm gonna put them all here so we can track them easier. I created an excel sheet similar to yours, and on the App Start I did the following:chartcollections.PNG

 

Then I set the items of my chart to colMyChartSource. and here is the result:chart.PNG

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

Please Accept as Solution if this post answered your question so other members can find it. If you found this post helpful consider giving my post a Thumbs Up!

View solution in original post

6 REPLIES 6
Highlighted
Edwin-Abdalian
Level 10

Re: Create a Pie Chart that Show Only New and On Going Project

So you have a pie chart in your canvas app, and it reads the data from an excel table? you need to use the Filter function on your datasource to exclude completed projects.

Items: Filter(yourExcelDataSource, Status <> "Completed")

ojack21
Level: Powered On

Re: Create a Pie Chart that Show Only New and On Going Project

i thought it was that easy too, here are some more info from what I am currently working on:

 

i have a screen with this code in the OnVisible:

Clear(OnTrack_C);
Clear(OffTrack_C);
ForAll(
       Project_Tracker,
       If("On_Off_Track" = "On Track",Collect(OnTrack_C,1));
       If("On_Off_Track" = "Off Track",Collect(OffTrack_C,1))
);
ClearCollect(
           PieDataTrack,
           {Stats: "OnTrack", Count_P: CountRows(OnTrack_C)},
           {Stats: "OffTrack" ,Count_P: CountRows(OffTrack_C)}
)

 

Then in my Pie Chart Items, I got this:

AddColumns(AddColumns(GroupBy(Project_Tracker, "On_Off_Track", "ProjectTracker"), "TrackerCount", CountRows(ProjectTracker)), "TrackLabel", Text(CountRows(ProjectTracker)/Value(Textbox.Text)*100, "[$-en-US]%#.00"))

 

I did try your suggestion before I posted this, it looked like this, but the chart is still not correct:

AddColumns(AddColumns(GroupBy(Filter(Project_Tracker, Status1.Value = "In Progress"), "On_Off_Track", "ProjectTracker"), "TrackerCount", CountRows(ProjectTracker)), "TrackLabel", Text(CountRows(ProjectTracker)/Value(Textbox.Text)*100, "[$-en-US]%#.00"))

 

 

Edwin-Abdalian
Level 10

Re: Create a Pie Chart that Show Only New and On Going Project

I used a different approach and created a few collections to prepare my data for the chart. of course you can combine some of the steps but I'm gonna put them all here so we can track them easier. I created an excel sheet similar to yours, and on the App Start I did the following:chartcollections.PNG

 

Then I set the items of my chart to colMyChartSource. and here is the result:chart.PNG

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

Please Accept as Solution if this post answered your question so other members can find it. If you found this post helpful consider giving my post a Thumbs Up!

View solution in original post

ojack21
Level: Powered On

Re: Create a Pie Chart that Show Only New and On Going Project

hi @Edwin-Abdalian, the fact that you're taking time to help me already deserves a thumbs up. 🙂

I believe, the solution you provided works just fine, I tried applying this to a Sharepoint list though, somehow, the pie chart is blank although there's no error in the script other than 'delegation' warning for '<>'.

 

Any thoughts how this can work for a SP list as well? Thanks again. 

Edwin-Abdalian
Level 10

Re: Create a Pie Chart that Show Only New and On Going Project

Thanks @ojack21  .could you share the schema of your SharePoint list?

ojack21
Level: Powered On

Re: Create a Pie Chart that Show Only New and On Going Project

I managed to figure it out! Thank you so much @Edwin-Abdalian, awesome support! Smiley Very Happy 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,593)