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 / Filter and Sum chart b...
Power Apps
Answered

Filter and Sum chart based on multiple drop down selections

(0) ShareShare
ReportReport
Posted on by 141

Hi Team,

I am creating a gallery with multiple cascading drop down lists. I have connected the gallery to a chart so the user can see a visual of the gallery results. 

 

However, while my dropdown boxes are filtered by distinct values, my gallery has multiple duplicate rows with the same status (i.e. "Role Status" has 35 rows with the term: "Filled".) 

 

My questions is: How can I consolidate all duplicates and return a sum of values based on the category selected by the user: 

Example:

User selects the Department drop down: 

the chart should provide the following:

1)Total Role Status = Vacant

2)Total Role Status = Filled

3)Total Department = CRM

Etc

 

I've managed to filter the chart based on drop downs but I am unable to consolidate and sum the results. 

Annasuela__0-1663009643633.pngAnnasuela__1-1663009663191.pngAnnasuela__2-1663009698678.png

Any help you can provide would be greatly appreciated. 

 

Thank you,

Anna

 

    

 

 

Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,940 Most Valuable Professional on at

    Hi @Annasuela_ ,

    Firstly, can you please remember to post any code as Text also - your totals would be something like this

    AddColumns(
     GroupBy(
     Filter(
     TechProdHCTracker,
     'Tech Prod' = DropdownTechProd.Selected.Result
     ),
     "Role Status",
     "Data"
     ),
     "MyTotals"
     Sum(
     Data,
     YourValueField
     )
    )

     

    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.

    Visit my blog Practical Power Apps

  • Annasuela_ Profile Picture
    141 on at

    Hi Warren - Thank you so much for the reminder. I will absolutely do so in the future as I realize it may come handy when troubleshooting. 

    I replaced the Chart's items property with the formula you provided and I am receiving the following error:

     

    Annasuela__0-1663014775982.png

    Here's the formula:

    AddColumns(GroupBy(Filter(TechProdHCTracker,'Tech/Prod' = DropdownTechProd.Selected.Result), "Tech/Prod", "Data"),"MyTotals", Sum(Data,'Tech/Prod'))

     

    Thank you again. 

    Anna

     

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

    Hi @Annasuela_ ,

    Two things - the error is that 'Tech/Prod' does not exist, please check you field names. Secondly, the Sum() at the bottom needs to be the field containing the value, not Tech/Prod which will not be in the Data table as you are grouping by it. Lastly, it is a very good idea not to use special characters (or spaces) in field names.

     

    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.

    Visit my blog Practical Power Apps

  • Annasuela_ Profile Picture
    141 on at

    Hi @WarrenBelz - Thank you so much for the prompt response.

     

    Per your recommendation, I removed special characters and spaces and replaced them with a "_" between each word.

     

    However, I keep getting an error where the system is not recognizing the column:

    Annasuela__1-1663074115896.png

     

    However, as you can see, my they exist in my SharePoint list: 

     

    Annasuela__2-1663074158835.png

     

    This is the code: AddColumns(GroupBy(Filter(TechProdHCTracker,Tech_Prod = DropdownTechProd.Selected.Result), "Role_Status", "Data"),"MyTotals", Sum(Data,Role_Status)) 

     

    Thank you again for all your help with this! 

     

  • Annasuela_ Profile Picture
    141 on at

    Hi @WarrenBelz - I managed to get the formula to work without errors.

     

    Do I insert the formula on the items property of the chart or items property of the gallery?  The chart is not populating when I insert the formula on the items property of the chart and the formula is not giving me any errors.

     

    Thank you again in advance for all your assistance. 

    Anna 

  • Annasuela_ Profile Picture
    141 on at

    Hi @WarrenBelz - I got it to work. 🙂

     

    Last questions for this subject: Can I add totals for each category? also, can I add other columns so I can further sort this chart based on the other drop down boxes such as "leader" and "supervisor"?

     

    Annasuela__0-1663088479231.png

     

    Here's my code: AddColumns(GroupBy(Filter(TechProdHCTracker,Tech_Prod = DropdownTechProd.Selected.Result),"field_6","Data"),"MyTotal",Sum(Data,ID))

     

    Thank you so much! 

    Anna

     

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

    Hi @Annasuela_ ,

    The formula is the Items of whatever you want to show. Why are you summing the ID ?

  • Annasuela_ Profile Picture
    141 on at

    Hi @WarrenBelz - Yes, you are correct regarding the formula.

     

    I managed to add the "countRows" formula which provided the values I was looking for. I summed the "ID" initially as the formula was not providing me with the value I was looking for, however, I revised the formula to the following which, in the end, gave me what I was looking for. The values by each category in a chart. 

    Annasuela__0-1663100700598.png

    Annasuela__1-1663100750654.png

    I will go ahead and mark this matter complete. 

     

    Thank you so much for all your help and I hope you have a wonderful day! 🙂

     

    Anna 

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 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard