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 / Creating Pie Charts in...
Power Apps
Unanswered

Creating Pie Charts in Power Apps

(1) ShareShare
ReportReport
Posted on by 280

PAJ_0-1713633171998.png

I have a gallery with distinct assignee names i.e XYZ and PQR

For the above sample data , i need 2 pie charts 

1) Which will show 'Priority' piechart whenever a assignee i.e either (XYZ or PQR) is selected in Gallery

2) Which will show 'Type' piechart whenever a assignee i.e either (XYZ or PQR) is selected in Gallery

Categories:
I have the same question (0)
  • Verified answer
    Robu1 Profile Picture
    1,459 Super User 2025 Season 2 on at

    Hi @PAJ ,

     

    Certainly! To create the two pie charts based on the assignee names (XYZ and PQR) in your gallery, follow these steps:

    1. Create a Pie Chart for Priority:

      • Assume you have a table or collection called Assignees with columns AssigneeName, Priority, and Type.
      • Add a combo box (let’s call it ComboBoxAssignee) to your canvas app and set its Items property to: Distinct(Assignees, AssigneeName)
      • Create a pie chart control and set its Items property to:
        ShowColumns(
         AddColumns(
         GroupBy(
         Filter(Assignees, AssigneeName = ComboBoxAssignee.Selected.Result || IsBlank(ComboBoxAssignee.Selected)),
         "Priority",
         "PriorityGroup"
         ),
         "Count",
         CountRows(PriorityGroup),
         "Label",
         Priority & ":" & CountRows(PriorityGroup)
         ),
         "Label",
         "Count"
        )
      • This will display a pie chart showing the count of each priority when an assignee (either XYZ or PQR) is selected in the gallery.
    2. Create a Pie Chart for Type:

      • Similarly, create another pie chart control and set its Items property to:
        ShowColumns(
         AddColumns(
         GroupBy(
         Filter(Assignees, AssigneeName = ComboBoxAssignee.Selected.Result || IsBlank(ComboBoxAssignee.Selected)),
         "Type",
         "TypeGroup"
         ),
         "Count",
         CountRows(TypeGroup),
         "Label",
         Type & ":" & CountRows(TypeGroup)
         ),
         "Label",
         "Count"
        )
      • This will display a pie chart showing the count of each type when an assignee (either XYZ or PQR) is selected in the gallery.

    Remember to adjust the table or collection names and column names according to your actual data.

     

     If you have any further questions or need additional assistance, feel free to ask! 😊

     

    If this post helps, then Click on the Thumbs Up below and Accept it as the solution to help others.
     
    Thanks,
     
    Robu1. 
  • v-qiaqi@microsoft.com Profile Picture
    on at

    Hi @PAJ,

    Could you please tell me how you set the Items property pof your Gallery?

    This decides how you refer to gallery selected assignee name and Priority.

     

    AddColumns(GroupBy(Filter(data,'Assignee Name'=Gallery.Selected.'Assignee Name'),"Priority","PG"),"PCount",CountRows(PG))

    Note that you need to refer to correct returned column name in your Gallery, I refer to 'Assignee Name' directly, you need to check how you set the Text property of the Label where you display 'Assignee Name', the field name after ThisItem is the real field name you need to refer to.

     

    Same as Type PieChart:

    AddColumns(GroupBy(Filter(data,'Assignee Name'=Gallery.Selected.'Assignee Name'),"Type","TG"),"TCount",CountRows(TG))
    

     

  • PAJ Profile Picture
    280 on at

    Thank you it worked . Any tips on how i can practice these formulas ? 

  • Robu1 Profile Picture
    1,459 Super User 2025 Season 2 on at

    Hi @PAJ,

     

    Certainly! Practicing Power Apps formulas is essential to become proficient in building apps. Here are some effective ways to practice:

    1. Learn the Basics:

      • Familiarize yourself with the basic functions and operators used in Power Apps.
      • Understand how to manipulate data, create variables, and work with controls.
    2. Explore the Formula Reference:

    3. Watch Tutorials and Webinars:

    4. Create Mini Projects:

      • Build small apps or prototypes using different formulas.
      • Create a simple expense tracker, a task manager, or a contact list app.
      • Apply formulas for data validation, navigation, and user interactions.
    5. Experiment with Real Data:

      • Use sample data or connect to external data sources (like SharePoint or SQL databases).
      • Practice retrieving, filtering, and displaying data using formulas.
    6. Challenge Yourself:

      • Set specific tasks or challenges related to app development.
      • For instance, create a form with conditional visibility, implement cascading dropdowns, or calculate aggregate values.
    7. Join Communities and Forums:

      • Participate in Power Apps communities, forums, and discussion groups.
      • Share your formulas, ask questions, and learn from others’ experiences.

    Remember that consistent practice and hands-on experience are key to mastering Power Apps formulas. Start with simple tasks and gradually tackle more complex scenarios.

     

    Happy app-building! 😊🚀📱

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