Skip to main content

Notifications

Community site session details

Community site session details

Session Id : FHAlRTPJ7kDZRWFXLWc2/l
Power Apps - Building Power Apps
Answered

Creating Pie Charts in Power Apps

Like (1) ShareShare
ReportReport
Posted on 20 Apr 2024 17:27:10 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

  • Robu1 Profile Picture
    1,206 Super User 2025 Season 1 on 22 Apr 2024 at 20:45:10
    Re: Creating Pie Charts in Power Apps

    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! 😊🚀📱

  • PAJ Profile Picture
    280 on 22 Apr 2024 at 04:48:50
    Re: Creating Pie Charts in Power Apps

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

  • v-qiaqi@microsoft.com Profile Picture
    on 22 Apr 2024 at 03:01:40
    Re: Creating Pie Charts in Power Apps

    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))
    

     

  • Verified answer
    Robu1 Profile Picture
    1,206 Super User 2025 Season 1 on 21 Apr 2024 at 18:30:19
    Re: Creating Pie Charts in Power Apps

    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. 

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!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,751 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard
Loading started