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 / Pie chart from collection
Power Apps
Unanswered

Pie chart from collection

(0) ShareShare
ReportReport
Posted on by 55

Hi all,

 

I have read alot of info around charts in Power Apps, but just cannot get mine to return any values!

 

I have created a collection in my apps 'OnStart property as below:

 

Set(varCurrentUser, LookUp(Users, Email = User().Email));

ClearCollect(
colFinishedPredictions,
Filter(Predictions, LookUp(Events, EventFinal = EventName).EventFinished = "Yes")
);

ClearCollect(
colPredictionsSummary,
{
PredictionType: "Gold",
Count: CountRows(Filter(colFinishedPredictions, Points = 5))
},
{
PredictionType: "Silver",
Count: CountRows(Filter(colFinishedPredictions, Points = 3))
},
{
PredictionType: "Bronze",
Count: CountRows(Filter(colFinishedPredictions, Points = 1))
},
{
PredictionType: "Incorrect",
Count: CountRows(Filter(colFinishedPredictions, Points = -1))
},
{
PredictionType: "No Prediction",
Count: CountRows(Filter(colFinishedPredictions, Points = 0))
}
);

 

 

Then within my pie chart I have set the 'items' property to 'colPredictionsSummary' , with PredictionType and Count added as data points 

CG83_0-1718120498786.png

 

In my pie chart, this is not returning anything! As below:

 

CG83_1-1718120671585.png

 

I cant establish what I am doing wrong with this, but this is the final step of my app so REALLY frustrating that I cant get it right. Is anybody able to point out the (hopefully obvious) mistake that I am making?

 

Categories:
  • madlad Profile Picture
    2,637 Moderator on at

    Hi!

     

    Pie charts will appear like this if all the values are zero.

    It looks like the most likely reason for this is that the CountRows(...) are all returning zero. 

     

    What column type is points?

    If it's not numerical, try replacing the "colFinishedPredictions" with "Value(colFinishedPredictions)"

     

    Let me know how it goes!

  • CG83 Profile Picture
    55 on at

    Thanks for the reply. You are right. The countrows steps are returning a value of 0 (I added a text label to test each of these).

    I even removed the filter section and just checked 

    CountRows(colFinishedPredictions)
    This returns a 0 value as well which I guess means the issue is with the section of the onstart code 
    ClearCollect(
        'colFinishedPredictions',
        Filter(Predictions, LookUp(Events, EventFinal = EventName).EventFinished = "Yes")
    );

     

    I have checked within excel that the text in EventFinal matches the text in EventName and it does. 

     

    I am baffled!

  • madlad Profile Picture
    2,637 Moderator on at

    @CG83 

    Just looking at this ClearCollect here, and I just want to confirm what you're getting. How do your data sources 'predictions' and 'events' relate? 

    I suspect you have to change the ClearCollect() a bit here.

     

    Let me know!

     

  • CG83 Profile Picture
    55 on at

    So..... My 'events' table looks as below:

     

    CG83_0-1718290201293.png

    This holds all of the event info and shows if the event remains open. 

     

    Then the 'Predictions' table looks like this:

     

    CG83_2-1718290379793.png

     

     

    I guess my Pie Chart needs to get a list of events from the 'events' table that have finished then cross reference these in the predictions table, filter by user and then show the medal allocation?

  • CG83 Profile Picture
    55 on at

    Can anybody help with this?

  • WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    Hi @CG83 ,

    The first problem is this

    ClearCollect(
     colFinishedPredictions,
     Filter(
     Predictions, 
     LookUp(
     Events, 
     EventFinal = EventName
     ).EventFinished = "Yes"
     )
    );

    You are filtering Predictions, but then looking up Events without any referral to the field in Predictions that needs to match whatever those records return. It seems from your table images that it is EventName so try this

    ClearCollect(
     colFinishedPredictions,
     Filter(
     AddColumns(
     Predictions,
     Finished,
     LookUp(
     Events,
     EventFinal = EventName
     ).EventFinished
     ),
     Finished = "Yes" 
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 312

#3
Mohsin Ali Profile Picture

Mohsin Ali 252

Last 30 days Overall leaderboard