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 / Piechart with Dropdown
Power Apps
Unanswered

Piechart with Dropdown

(0) ShareShare
ReportReport
Posted on by 20

Hi, 

 

I'm having some trouble getting a formula to work for me to display a piechart the way i want. 

I have a dropdown list whose OnSelect property creates a collection for me: ClearCollect(ProgressTracker, ShowColumns('Tool & Die',"TotalHours","Hours_x002d_EDM","FullName"))

 

I then have a piechart where i want it to display collection items based on the dropdown selected name along with summarizing the collections values - Total hours vs Required hours. The two formulas that work fine independently but i want to combine are:

If(Dropdown1_1.Selected.Value = "Carol Barry",ProgressTracker,Dropdown1_1.Selected.Value="Darry De Guzman",ProgressTracker)

AND

AddColumns(GroupBy(ProgressTracker,"TotalHours","Hours_x002d_EDM"),"Count",Sum(Hours_x002d_EDM,TotalHours))

 

I've tried so many different things but it will not work such as a comma, semi colon, ||, etc. Please help me out. 

 

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,991 Moderator on at

    @faithdwn 

    I made an attempt at putting together the two functions here.  Let me know if it works.

     

    DropColumns(
     AddColumns(
     GroupBy(
     Filter(ProgressTracker, EmployeeName=Dropdown1_1.Selected.Value),
     "EmployeeName","TotalHours"
     ),
     "Count", Sum(TotalHours,Hours_x002d_EDM)
     ),
     "TotalHours"
    )

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @faithdwn ,

    Do you want to display pie chart based on the selection of drop down?

    Could you show me 

    1)the fields data type in the collection?

    2)data examples of your collection?

    Since I do not quite know what the data like in your collection, so I could not directly show you the detailed formula.

    Are you sure the first formula?

    If(Dropdown1_1.Selected.Value = "Carol Barry",ProgressTracker,Dropdown1_1.Selected.Value="Darry De Guzman",ProgressTracker)

    The two results are the same. So please correct this.

     

     

    Best regards,

  • faithdwn Profile Picture
    20 on at

    Hi @v-yutliu-msft and @rgruian 

     

    Thanks for your responses!!

     
     
     
     
     
     
     
     
     
     

    Yes - I have a sp list that collects each employees info. I want the piechart to display the individuals required hours vs accumulated hours based on the selected drop down. Drop down includes all their names. 

    The collection includes the full name, required hours, and accumulated hours. 

     

    The formula provided kind of works but does not distinguish the sum of Total hours vs sum

    accumulated hours. 

    DropColumns(AddColumns(GroupBy(Filter(ProgressTracker,"Carol Barry"=Dropdown1_1.Selected.Value||"Darryl De Guzman"=Dropdown1_1.Selected.Value),"Hours_x002d_EDM","TotalHours"),"Count",Sum(TotalHours,Hours_x002d_EDM)),"TotalHours")

     

    Should the legend have the same formula as the chart?

     

    Photo below:

    faithdwn_0-1594739134995.png

    faithdwn_3-1594739296893.png

     

     

  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @faithdwn ,

    Could you tell me

    1)the fieldnames in details of your data source and their data type?

    2) the logic that you want to calculate?

    I'm not sure how do you want to calculate  the sum of Total hours and the sum accumulated hours. 

     

     

    Best regards,

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 342 Most Valuable Professional

#2
11manish Profile Picture

11manish 234

#3
Valantis Profile Picture

Valantis 187

Last 30 days Overall leaderboard